Package org.eclipse.jetty.http
Enum HttpCompliance
- All Implemented Interfaces:
Serializable,Comparable<HttpCompliance>,java.lang.constant.Constable
HTTP compliance modes for Jetty HTTP parsing and handling.
A Compliance mode consists of a set of
HttpComplianceSections 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 the RFC2616_LEGACY HttpCompliance is defined as
RFC2616,-FIELD_COLON,-METHOD_CASE_SENSITIVE.
Note also that the EnumSet return by sections() is mutable, so that modes may
be altered in code and will affect all usages of the mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Deprecated.Deprecated.Deprecated.A Legacy compliance mode to match jetty's behavior prior to RFC2616 and RFC7230.The strict RFC2616 support modeThe 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.The RFC7230 support modeJetty's legacy RFC7230 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE.The RFC7230 support mode with no ambiguous URIs -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckUriCompliance(HttpCompliance compliance, HttpURI uri) static HttpCompliancerequiredCompliance(HttpComplianceSection section) sections()Get the set ofHttpComplianceSections supported by this compliance mode.static HttpComplianceReturns 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 Details
-
LEGACY
A Legacy compliance mode to match jetty's behavior prior to RFC2616 and RFC7230. -
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
The strict RFC2616 support mode -
RFC7230_LEGACY
Jetty's legacy RFC7230 support, which excludesHttpComplianceSection.METHOD_CASE_SENSITIVE. -
RFC7230
The RFC7230 support mode -
RFC7230_NO_AMBIGUOUS_URIS
The RFC7230 support mode with no ambiguous URIs -
CUSTOM0
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM0 -
CUSTOM1
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM1 -
CUSTOM2
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM2 -
CUSTOM3
Deprecated.Custom compliance mode that can be defined with System propertyorg.eclipse.jetty.http.HttpCompliance.CUSTOM3
-
-
Field Details
-
VIOLATIONS_ATTR
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
requiredCompliance
- Parameters:
section- The section to query- Returns:
- The minimum compliance required to enable the section.
-
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
-