Class HttpTokens
java.lang.Object
org.eclipse.jetty.http.HttpTokens
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
static enum
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpTokens.Token
getToken
(byte b) static HttpTokens.Token
getToken
(char c) static boolean
isIllegalFieldVchar
(char c) Checks whether this is an invalid VCHAR based on RFC9110.static boolean
isLegalFieldValue
(String fieldValue) Check if the providedfieldValue
string is compliant with RFC9110.static boolean
isLegalH2H3FieldName
(String fieldName) Check if thefieldName
string is compliant with RFC9110, RFC9113 and RFC9114.static char
sanitizeFieldVchar
(char c) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
TOKENS
-
-
Constructor Details
-
HttpTokens
public HttpTokens()
-
-
Method Details
-
getToken
-
getToken
-
sanitizeFieldVchar
Deprecated, for removal: This API element is subject to removal in a future version.This is used when decoding to not decode illegal characters based on RFC9110. CR, LF, or NUL are replaced with ' ', all other control and multibyte characters are replaced with '?'. If this is given a legal character the same value will be returned.field-vchar = VCHAR / obs-text obs-text = %x80-FF VCHAR = %x21-7E
- Parameters:
c
- the character to test.- Returns:
- the original character or the replacement character ' ' or '?', the return value is guaranteed to be a valid ISO-8859-1 character.
-
isIllegalFieldVchar
public static boolean isIllegalFieldVchar(char c) Checks whether this is an invalid VCHAR based on RFC9110. If this not a valid ISO-8859-1 character or a control character we say that it is illegal.- Parameters:
c
- the character to test.- Returns:
- true if this is invalid VCHAR.
-
isLegalH2H3FieldName
Check if thefieldName
string is compliant with RFC9110, RFC9113 and RFC9114.This method does not validate whether HTTP/2 and HTTP/3 pseudo headers are known (this must be done by caller code).
- Parameters:
fieldName
- the field name to check.- Returns:
- true if this is a legal field name.
-
isLegalFieldValue
Check if the providedfieldValue
string is compliant with RFC9110.- Returns:
- true if this is a legal field value.
-