- java.lang.Object
-
- java.lang.Enum<HttpCompliance.Violation>
-
- org.eclipse.jetty.http.HttpCompliance.Violation
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<HttpCompliance.Violation>,ComplianceViolation
- Enclosing class:
- HttpCompliance
public static enum HttpCompliance.Violation extends java.lang.Enum<HttpCompliance.Violation> implements ComplianceViolation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.ComplianceViolation
ComplianceViolation.Listener, ComplianceViolation.Mode
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CASE_INSENSITIVE_METHODThe HTTP RFC(s) require that method names are case sensitive, so that "Get" and "GET" are considered different methods.CASE_SENSITIVE_FIELD_NAMEThe 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.HTTP_0_9Since RFC 7230, the expectation that HTTP/0.9 is supported has been removed from the specification.MULTILINE_FIELD_VALUESince RFC 7230, the HTTP protocol no longer supports line folding, which allows a field value to be provided over several lines.MULTIPLE_CONTENT_LENGTHSSince RFC 7230, the HTTP protocol has required that a request is invalid if it contains multipleContent-Lengthfields or values.NO_COLON_AFTER_FIELD_NAMEPrior 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.TRANSFER_ENCODING_WITH_CONTENT_LENGTHSince RFC 7230, the HTTP protocol has required that a request is invalid if it contains both aTransfer-Encodingfield andContent-Lengthfield.WHITESPACE_AFTER_FIELD_NAMESince 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()java.lang.StringgetName()java.lang.StringgetURL()static HttpCompliance.ViolationvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static HttpCompliance.Violation[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.eclipse.jetty.http.ComplianceViolation
isAllowedBy
-
-
-
-
Enum Constant Detail
-
CASE_SENSITIVE_FIELD_NAME
public static final HttpCompliance.Violation 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 theirHttpCompliancemode 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
public static final HttpCompliance.Violation 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 theHttpCompliancemode.
-
HTTP_0_9
public static final HttpCompliance.Violation 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'sHttpCompliancemode.
-
MULTILINE_FIELD_VALUE
public static final HttpCompliance.Violation 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 theirHttpCompliancemode.
-
MULTIPLE_CONTENT_LENGTHS
public static final HttpCompliance.Violation MULTIPLE_CONTENT_LENGTHS
Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains multipleContent-Lengthfields 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-Lengthvalues to be received, but only if they are identical.
-
TRANSFER_ENCODING_WITH_CONTENT_LENGTH
public static final HttpCompliance.Violation TRANSFER_ENCODING_WITH_CONTENT_LENGTH
Since RFC 7230, the HTTP protocol has required that a request is invalid if it contains both aTransfer-Encodingfield andContent-Lengthfield. A deployment may include this violation to allow both fields to be in a received request.
-
WHITESPACE_AFTER_FIELD_NAME
public static final HttpCompliance.Violation 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
public static final HttpCompliance.Violation 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.
-
-
Method Detail
-
values
public static HttpCompliance.Violation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpCompliance.Violation c : HttpCompliance.Violation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpCompliance.Violation valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceComplianceViolation- Returns:
- The name of the violation.
-
getURL
public java.lang.String getURL()
- Specified by:
getURLin interfaceComplianceViolation- Returns:
- A URL to the specification that provides more information regarding the requirement that may be violated.
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceComplianceViolation- Returns:
- A short description of the violation.
-
-