Package org.eclipse.jetty.http
Enum HttpCompliance
- java.lang.Object
-
- java.lang.Enum<HttpCompliance>
-
- org.eclipse.jetty.http.HttpCompliance
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<HttpCompliance>
public enum HttpCompliance extends java.lang.Enum<HttpCompliance>
HTTP compliance modes for Jetty HTTP parsing and handling. A Compliance mode consists of a set ofHttpComplianceSections which are applied when the mode is enabled.Currently the set of modes is an enum and cannot be dynamically extended, but future major releases may convert this to a class. To modify modes there are four custom modes that can be modified by setting the property
org.eclipse.jetty.http.HttpCompliance.CUSTOMn(where 'n' is '0', '1', '2' or '3'), to a comma separated list of sections. The list should start with one of the following strings:- 0
- No
HttpComplianceSections - *
- All
HttpComplianceSections - RFC2616
- The set of
HttpComplianceSections application to https://tools.ietf.org/html/rfc2616, but not https://tools.ietf.org/html/rfc7230 - RFC7230
- The set of
HttpComplianceSections application to https://tools.ietf.org/html/rfc7230
HttpComplianceSections to include them in the mode, or prefixed with a '-' to exclude thm from the mode. Note that Jetty's modes may have some historic minor differences from the strict RFC compliance, for example theRFC2616_LEGACYHttpCompliance is defined asRFC2616,-FIELD_COLON,-METHOD_CASE_SENSITIVE.Note also that the
EnumSetreturn bysections()is mutable, so that modes may be altered in code and will affect all usages of the mode.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CUSTOM0Deprecated.CUSTOM1Deprecated.CUSTOM2Deprecated.CUSTOM3Deprecated.LEGACYA Legacy compliance mode to match jetty's behavior prior to RFC2616 and RFC7230.RFC2616The strict RFC2616 support modeRFC2616_LEGACYThe legacy RFC2616 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE,HttpComplianceSection.FIELD_COLON,HttpComplianceSection.TRANSFER_ENCODING_WITH_CONTENT_LENGTH,HttpComplianceSection.MULTIPLE_CONTENT_LENGTHS,HttpComplianceSection.NO_AMBIGUOUS_PATH_SEGMENTSandHttpComplianceSection.NO_AMBIGUOUS_PATH_SEPARATORS.RFC7230The RFC7230 support modeRFC7230_LEGACYJetty's legacy RFC7230 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE.RFC7230_NO_AMBIGUOUS_URISThe RFC7230 support mode with no ambiguous URIs
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVIOLATIONS_ATTR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckUriCompliance(HttpCompliance compliance, HttpURI uri)static HttpCompliancerequiredCompliance(HttpComplianceSection section)java.util.EnumSet<HttpComplianceSection>sections()Get the set ofHttpComplianceSections supported by this compliance mode.static HttpCompliancevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static HttpCompliance[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LEGACY
public static final HttpCompliance LEGACY
A Legacy compliance mode to match jetty's behavior prior to RFC2616 and RFC7230.
-
RFC2616_LEGACY
public static final HttpCompliance RFC2616_LEGACY
The legacy RFC2616 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE,HttpComplianceSection.FIELD_COLON,HttpComplianceSection.TRANSFER_ENCODING_WITH_CONTENT_LENGTH,HttpComplianceSection.MULTIPLE_CONTENT_LENGTHS,HttpComplianceSection.NO_AMBIGUOUS_PATH_SEGMENTSandHttpComplianceSection.NO_AMBIGUOUS_PATH_SEPARATORS.
-
RFC2616
public static final HttpCompliance RFC2616
The strict RFC2616 support mode
-
RFC7230_LEGACY
public static final HttpCompliance RFC7230_LEGACY
Jetty's legacy RFC7230 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE.
-
RFC7230
public static final HttpCompliance RFC7230
The RFC7230 support mode
-
RFC7230_NO_AMBIGUOUS_URIS
public static final HttpCompliance RFC7230_NO_AMBIGUOUS_URIS
The RFC7230 support mode with no ambiguous URIs
-
CUSTOM0
@Deprecated public static final HttpCompliance CUSTOM0
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM0
-
CUSTOM1
@Deprecated public static final HttpCompliance CUSTOM1
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM1
-
CUSTOM2
@Deprecated public static final HttpCompliance CUSTOM2
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM2
-
CUSTOM3
@Deprecated public static final HttpCompliance CUSTOM3
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM3
-
-
Field Detail
-
VIOLATIONS_ATTR
public static final java.lang.String VIOLATIONS_ATTR
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static HttpCompliance[] 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 c : HttpCompliance.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 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
-
requiredCompliance
public static HttpCompliance requiredCompliance(HttpComplianceSection section)
- Parameters:
section- The section to query- Returns:
- The minimum compliance required to enable the section.
-
sections
public java.util.EnumSet<HttpComplianceSection> sections()
Get the set ofHttpComplianceSections supported by this compliance mode. This set is mutable, so it can be modified. Any modification will affect all usages of the mode within the sameClassLoader.- Returns:
- The set of
HttpComplianceSections supported by this compliance mode.
-
checkUriCompliance
public static java.lang.String checkUriCompliance(HttpCompliance compliance, HttpURI uri)
-
-