Package io.undertow.server.protocol.http
Class HttpRequestParser
java.lang.Object
io.undertow.server.protocol.http.HttpRequestParser
The basic HTTP parser. The actual parser is a sub class of this class that is generated as part of
the build process by the
AbstractParserGenerator annotation processor.
The actual processor is a state machine, that means that for common header, method, protocol values it will return an interned string, rather than creating a new string for each one.
- Author:
- Stuart Douglas
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState currentState, HttpServerExchange builder) protected voidhandleAfterVersion(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state) protected booleanhandleCachedHeader(String existing, ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state, HttpServerExchange builder) protected static Map<String,HttpString> This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes.static final HttpRequestParserinstance(org.xnio.OptionMap options) static booleanisTargetCharacterAllowed(char c)
-
Field Details
-
HTTP_LENGTH
public static final int HTTP_LENGTH
-
-
Constructor Details
-
HttpRequestParser
public HttpRequestParser(org.xnio.OptionMap options)
-
-
Method Details
-
isTargetCharacterAllowed
public static boolean isTargetCharacterAllowed(char c) -
instance
-
handle
public void handle(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState currentState, HttpServerExchange builder) throws BadRequestException - Throws:
BadRequestException
-
handleCachedHeader
protected boolean handleCachedHeader(String existing, ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state, HttpServerExchange builder) throws BadRequestException - Throws:
BadRequestException
-
handleAfterVersion
protected void handleAfterVersion(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state) throws BadRequestException - Throws:
BadRequestException
-
httpStrings
This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes. This means that in most cases a HttpString comparison will take the fast path == route, as they will be the same object- Returns:
-