Package org.eclipse.jetty.http
Enum Class HttpCompliance.Violation
- All Implemented Interfaces:
Serializable
,Comparable<HttpCompliance.Violation>
,Constable
,ComplianceViolation
- Enclosing class:
- HttpCompliance
public static enum HttpCompliance.Violation
extends Enum<HttpCompliance.Violation>
implements ComplianceViolation
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.ComplianceViolation
ComplianceViolation.CapturingListener, ComplianceViolation.Event, ComplianceViolation.Listener, ComplianceViolation.LoggingListener, ComplianceViolation.Mode
-
Enum Constant Summary
Enum ConstantDescriptionThe HTTP RFC(s) require that method names are case-sensitive, so that "Get
" and "GET
" are considered different methods.The HTTP RFC(s) require that field names are case-insensitive, so for example the fields "Content-Type: text/xml
" and "content-type: text/xml
" are considered equivalent.Since RFC 7230: Section 5.4, the HTTP protocol says that a Server must reject a request duplicate host headers.Since RFC 7230, the expectation that HTTP/0.9 is supported has been removed from the specification.Since RFC 7230: Section 5.4, the HTTP protocol must reject a request if the target URI has an authority that is different than a provided Host header.Since RFC 7230, the HTTP protocol no longer supports line folding, which allows a field value to be provided over several lines.Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains multipleContent-Length
fields or values.Prior to RFC 7230, the HTTP protocol allowed a header line of a single token with neither a colon nor value following, to be interpreted as a field name with no value.Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains both aTransfer-Encoding
field andContent-Length
field.Since RFC 7230, the HTTP protocol should reject a request if the Host headers contains an invalid / unsafe authority.Since RFC 7230, the HTTP protocol has required that a request header field has no white space after the field name and before the ':'. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
getURL()
static HttpCompliance.Violation
Returns the enum constant of this class with the specified name.static HttpCompliance.Violation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.eclipse.jetty.http.ComplianceViolation
isAllowedBy
-
Enum Constant Details
-
CASE_SENSITIVE_FIELD_NAME
The HTTP RFC(s) require that field names are case-insensitive, so for example the fields "Content-Type: text/xml
" and "content-type: text/xml
" are considered equivalent. Jetty has been optimized to take advantage of this by looking up field names in a case-insensitive cache and will by default provide the standard capitalisation of a field name rather than create a new string with the actual capitalisation received. However, some applications have been written to expect a specific capitalisation of field, so deployments of such applications must include this violation in theirHttpCompliance
mode to prevent Jetty altering the case of the fields received. Jetty itself will still match and handle fields names insensitively and this violation only affects how the names are reported to the application. There is a small performance and garbage impact of using this mode. -
CASE_INSENSITIVE_METHOD
The HTTP RFC(s) require that method names are case-sensitive, so that "Get
" and "GET
" are considered different methods. Jetty releases prior to 9.4 used a case-insensitive cache to match method names, thus this requirement was violated. Deployments which wish to retain this legacy violation can include this violation in theHttpCompliance
mode. -
HTTP_0_9
Since RFC 7230, the expectation that HTTP/0.9 is supported has been removed from the specification. If a deployment wished to accept HTTP/0.9 requests, then it can include this violation in it'sHttpCompliance
mode. -
MULTILINE_FIELD_VALUE
Since RFC 7230, the HTTP protocol no longer supports line folding, which allows a field value to be provided over several lines. Deployments that wish to receive folder field values may include this violation in theirHttpCompliance
mode. -
MULTIPLE_CONTENT_LENGTHS
Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains multipleContent-Length
fields or values. The request may be treated as invalid even if the multiple values are the same. A deployment may include this violation to allow multipleContent-Length
values to be received, but only if they are identical. -
TRANSFER_ENCODING_WITH_CONTENT_LENGTH
Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains both aTransfer-Encoding
field andContent-Length
field. A deployment may include this violation to allow both fields to be in a received request. -
WHITESPACE_AFTER_FIELD_NAME
Since RFC 7230, the HTTP protocol has required that a request header field has no white space after the field name and before the ':'. A deployment may include this violation to allow such fields to be in a received request. -
NO_COLON_AFTER_FIELD_NAME
Prior to RFC 7230, the HTTP protocol allowed a header line of a single token with neither a colon nor value following, to be interpreted as a field name with no value. A deployment may include this violation to allow such fields to be in a received request. -
DUPLICATE_HOST_HEADERS
Since RFC 7230: Section 5.4, the HTTP protocol says that a Server must reject a request duplicate host headers. A deployment may include this violation to allow duplicate host headers on a received request. -
UNSAFE_HOST_HEADER
Since RFC 7230, the HTTP protocol should reject a request if the Host headers contains an invalid / unsafe authority. A deployment may include this violation to allow unsafe host headesr on a received request. -
MISMATCHED_AUTHORITY
Since RFC 7230: Section 5.4, the HTTP protocol must reject a request if the target URI has an authority that is different than a provided Host header. A deployment may include this violation to allow different values on the target URI and the Host header on a received request.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
- Specified by:
getName
in interfaceComplianceViolation
- Returns:
- The name of the violation.
-
getURL
- Specified by:
getURL
in interfaceComplianceViolation
- Returns:
- A URL to the specification that provides more information regarding the requirement that may be violated.
-
getDescription
- Specified by:
getDescription
in interfaceComplianceViolation
- Returns:
- A short description of the violation.
-