Class IllegalRequestContext
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. It can carry any byte the client
chose to send, including CR, LF, NUL and terminal control sequences, so anything that logs or
echoes it has to escape it first: written raw into a log it lets a client forge log lines or drive
the terminal that displays them, and written raw into a response body it is reflected input.
toString escapes it and is safe to log as it is; the field itself is not.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionIllegalRequestContext(scala.Option<HttpMethod> method, scala.Option<String> rawRequestTarget, scala.Option<HttpProtocol> protocol) -
Method Summary
Modifier and TypeMethodDescriptionstatic IllegalRequestContextapply(scala.Option<HttpMethod> method, scala.Option<String> rawRequestTarget, scala.Option<HttpProtocol> protocol) static IllegalRequestContextempty()A context that knows nothing about the request, used when no information could be recovered.Java APIJava APIJava APIscala.Option<HttpMethod>method()scala.Option<HttpProtocol>protocol()scala.Option<String>toString()
-
Constructor Details
-
IllegalRequestContext
public IllegalRequestContext(scala.Option<HttpMethod> method, scala.Option<String> rawRequestTarget, scala.Option<HttpProtocol> protocol)
-
-
Method Details
-
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
-
rawRequestTarget
-
protocol
-
getMethod
Java API- Returns:
- (undocumented)
- Since:
- 2.0.0
-
getRawRequestTarget
Java APIThe value is unvalidated, attacker-controlled input and has to be escaped before it is logged or echoed; see the class documentation.
- Returns:
- (undocumented)
- Since:
- 2.0.0
-
getProtocol
Java API- Returns:
- (undocumented)
- Since:
- 2.0.0
-
toString
-