Package brave.http

Class HttpServerRequest


public abstract class HttpServerRequest
extends HttpRequest
Marks an interface for use in HttpServerHandler.handleReceive(HttpServerRequest). This gives a standard type to consider when parsing an incoming context.
Since:
5.7
See Also:
HttpServerResponse
  • Constructor Details

  • Method Details

    • spanKind

      public final Span.Kind spanKind()
      Specified by:
      spanKind in class Request
    • parseClientIpAndPort

      public boolean parseClientIpAndPort​(Span span)
      Used by HttpServerHandler.handleReceive(HttpServerRequest) to add remote socket information about the client from the delegate.

      By default, this tries to parse the forwarded IP. Override to add client socket information when forwarded info is not available.

      Aside: It is more likely a server request object will be able to parse socket information as opposed to a client object. This is because client requests are often parsed before a network route is chosen, whereas server requests are parsed after the network layer.

      Returns:
      true if parsing was successful.
      Since:
      5.7
    • parseClientIpFromXForwardedFor

      protected boolean parseClientIpFromXForwardedFor​(Span span)
      Uses the first value in the "X-Forwarded-For" header, or returns false if not present.
      Since:
      5.10