Package org.eclipse.jetty.http
Enum Class HttpCompliance
- All Implemented Interfaces:
Serializable
,Comparable<HttpCompliance>
,Constable
HTTP compliance modes for Jetty HTTP parsing and handling.
A Compliance mode consists of a set of
HttpComplianceSection
s 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
HttpComplianceSection
s - *
- All
HttpComplianceSection
s - RFC2616
- The set of
HttpComplianceSection
s application to https://tools.ietf.org/html/rfc2616, but not https://tools.ietf.org/html/rfc7230 - RFC7230
- The set of
HttpComplianceSection
s application to https://tools.ietf.org/html/rfc7230
HttpComplianceSection
s 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_SEGMENTS
andHttpComplianceSection.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
FieldsModifier and TypeFieldDescriptionprivate static final Map<HttpComplianceSection,
HttpCompliance> private final EnumSet<HttpComplianceSection>
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCompliance
requiredCompliance
(HttpComplianceSection section) sections()
Get the set ofHttpComplianceSection
s supported by this compliance mode.private static EnumSet<HttpComplianceSection>
sectionsByProperty
(String property) (package private) static EnumSet<HttpComplianceSection>
sectionsBySpec
(String spec) static HttpCompliance
Returns the enum constant of this class with the specified name.static HttpCompliance[]
values()
Returns an array containing the constants of this enum class, 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_SEGMENTS
andHttpComplianceSection.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:
-
__required
-
_sections
-
-
Constructor Details
-
HttpCompliance
-
-
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
-
sectionsByProperty
-
sectionsBySpec
-
requiredCompliance
- Parameters:
section
- The section to query- Returns:
- The minimum compliance required to enable the section.
-
sections
Get the set ofHttpComplianceSection
s 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
HttpComplianceSection
s supported by this compliance mode.
-