Package org.eclipse.jetty.http
Class MultiPartCompliance
java.lang.Object
org.eclipse.jetty.http.MultiPartCompliance
- All Implemented Interfaces:
ComplianceViolation.Mode
The compliance mode for MultiPart handling.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MultiPartCompliance
LegacymultiPart/form-data
parsing which is slow, buggy, but forgiving to a fault.static final MultiPartCompliance
RFC7578multiPart/form-data
compliant parsing lenient to LF EOL and Content-Transfer-Encoding.static final MultiPartCompliance
Strict (RFC7578)multiPart/form-data
compliant strict parsing. -
Constructor Summary
ConstructorDescriptionMultiPartCompliance
(String name, Set<MultiPartCompliance.Violation> violations) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allows
(ComplianceViolation violation) static MultiPartCompliance
Create compliance set from string.static MultiPartCompliance
from
(Set<MultiPartCompliance.Violation> violations) Create compliance set from a set of allowed Violations.getKnown()
getName()
toString()
static MultiPartCompliance
-
Field Details
-
RFC7578_STRICT
Strict (RFC7578)multiPart/form-data
compliant strict parsing. -
RFC7578
RFC7578multiPart/form-data
compliant parsing lenient to LF EOL and Content-Transfer-Encoding. -
LEGACY
LegacymultiPart/form-data
parsing which is slow, buggy, but forgiving to a fault. This mode is not recommended for websites on the public internet. It will accept non-compliant preambles and inconsistent line termination that are in violation of RFC7578.
-
-
Constructor Details
-
MultiPartCompliance
-
-
Method Details
-
valueOf
-
from
Create compliance set from a set of allowed Violations.- Parameters:
violations
- A string of violations to allow:- Returns:
- the compliance from the string spec
-
from
Create compliance set from string.Format:
<BASE>[,[-]<violation>]...
BASE is one of:
- 0
- No
MultiPartCompliance.Violation
s - *
- All
MultiPartCompliance.Violation
s - <name>
- The name of a static instance of MultiPartCompliance (e.g.
LEGACY
).
The remainder of the list can contain then names of
MultiPartCompliance.Violation
s to include them in the mode, or prefixed with a '-' to exclude them from the mode. Examples are:0,CONTENT_TRANSFER_ENCODING
- Only allow
MultiPartCompliance.Violation.CONTENT_TRANSFER_ENCODING
*,-BASE64_TRANSFER_ENCODING
- Only all except
MultiPartCompliance.Violation.BASE64_TRANSFER_ENCODING
LEGACY,BASE64_TRANSFER_ENCODING
- Same as LEGACY plus
MultiPartCompliance.Violation.BASE64_TRANSFER_ENCODING
- Parameters:
spec
- A string describing the compliance- Returns:
- the MultiPartCompliance instance derived from the string description
-
getName
- Specified by:
getName
in interfaceComplianceViolation.Mode
- Returns:
- The name of the compliance violation mode.
-
allows
- Specified by:
allows
in interfaceComplianceViolation.Mode
- Parameters:
violation
- TheComplianceViolation
to test- Returns:
- true iff the violation is allowed by this mode.
-
getKnown
- Specified by:
getKnown
in interfaceComplianceViolation.Mode
- Returns:
- The immutable set of all known violations for this mode.
-
getAllowed
- Specified by:
getAllowed
in interfaceComplianceViolation.Mode
- Returns:
- The immutable set of violations allowed by this mode.
-
toString
-