Class IllegalRequestContext

java.lang.Object
org.apache.pekko.http.IllegalRequestContext

public final class IllegalRequestContext extends Object
What is known about a request that failed to parse, at the point where parsing gave up.

Every field is optional because a request can be rejected before that part of it has been read: a request with an unsupported method fails before the request target is seen, and one with an unparsable request target fails before the protocol is seen.

Note that rawRequestTarget is unvalidated, attacker-controlled input, by definition malformed whenever the rejection was caused by the request target itself. Anything that logs or echoes it has to escape it.

Since:
2.0.0
  • Constructor Details

    • IllegalRequestContext

      public IllegalRequestContext(scala.Option<HttpMethod> method, scala.Option<String> rawRequestTarget, scala.Option<HttpProtocol> protocol)
  • Method Details

    • empty

      public static IllegalRequestContext empty()
      A context that knows nothing about the request, used when no information could be recovered.

      Returns:
      (undocumented)
      Since:
      2.0.0
    • apply

      public static IllegalRequestContext apply(scala.Option<HttpMethod> method, scala.Option<String> rawRequestTarget, scala.Option<HttpProtocol> protocol)
    • method

      public scala.Option<HttpMethod> method()
    • rawRequestTarget

      public scala.Option<String> rawRequestTarget()
    • protocol

      public scala.Option<HttpProtocol> protocol()
    • getMethod

      public Optional<HttpMethod> getMethod()
      Java API

      Returns:
      (undocumented)
      Since:
      2.0.0
    • getRawRequestTarget

      public Optional<String> getRawRequestTarget()
      Java API

      Returns:
      (undocumented)
      Since:
      2.0.0
    • getProtocol

      public Optional<HttpProtocol> getProtocol()
      Java API

      Returns:
      (undocumented)
      Since:
      2.0.0
    • toString

      public String toString()
      Overrides:
      toString in class Object