Class HttpRequestParser

java.lang.Object
io.undertow.server.protocol.http.HttpRequestParser

public abstract class HttpRequestParser extends Object
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 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

      public static final HttpRequestParser instance(org.xnio.OptionMap options)
    • 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

      protected static Map<String,HttpString> 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: