Package org.eclipse.jetty.http
Class HttpTokens
- java.lang.Object
-
- org.eclipse.jetty.http.HttpTokens
-
public class HttpTokens extends java.lang.Object
HTTP constants
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpTokens.EndOfContent
static class
HttpTokens.Token
static class
HttpTokens.Type
-
Field Summary
Fields Modifier and Type Field Description (package private) static byte
CARRIAGE_RETURN
(package private) static byte
COLON
(package private) static byte[]
CRLF
(package private) static byte
LINE_FEED
(package private) static byte
SPACE
(package private) static byte
TAB
static HttpTokens.Token[]
TOKENS
-
Constructor Summary
Constructors Constructor Description HttpTokens()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isIllegalFieldVchar(char c)
Checks whether this is an invalid VCHAR based on RFC9110.static char
sanitizeFieldVchar(char c)
This is used when decoding to not decode illegal characters based on RFC9110.
-
-
-
Field Detail
-
COLON
static final byte COLON
- See Also:
- Constant Field Values
-
TAB
static final byte TAB
- See Also:
- Constant Field Values
-
LINE_FEED
static final byte LINE_FEED
- See Also:
- Constant Field Values
-
CARRIAGE_RETURN
static final byte CARRIAGE_RETURN
- See Also:
- Constant Field Values
-
SPACE
static final byte SPACE
- See Also:
- Constant Field Values
-
CRLF
static final byte[] CRLF
-
TOKENS
public static final HttpTokens.Token[] TOKENS
-
-
Method Detail
-
sanitizeFieldVchar
public static char sanitizeFieldVchar(char c)
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.
-
-