@Contract(threading=STATELESS) public class RequestValidateTrace extends Object implements org.apache.hc.core5.http.HttpRequestInterceptor
This class serves as an interceptor for HTTP TRACE requests, ensuring they adhere to specific security and protocol guidelines.
Responsibilities:
Authorization
and Cookie
.ProtocolException
if a body is present.Thread Safety: This class is stateless and therefore thread-safe, as indicated by its ThreadingBehavior.STATELESS
annotation.
Interceptor Behavior:
ProtocolException
if any Authorization
or Cookie
headers are present to prevent sensitive data leakage.ProtocolException
is thrown.HttpRequestInterceptor
,
HttpException
,
IOException
,
ProtocolException
,
Method.TRACE
,
HttpHeaders.AUTHORIZATION
,
HttpHeaders.COOKIE
Modifier and Type | Field and Description |
---|---|
static org.apache.hc.core5.http.HttpRequestInterceptor |
INSTANCE
Default instance of
RequestValidateTrace . |
Constructor and Description |
---|
RequestValidateTrace()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
process(org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.EntityDetails entity,
org.apache.hc.core5.http.protocol.HttpContext context)
Processes an incoming HTTP request.
|
public static final org.apache.hc.core5.http.HttpRequestInterceptor INSTANCE
RequestValidateTrace
.public void process(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entity, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException
ProtocolException
if the request contains an Authorization
header to prevent sensitive data leakage.ProtocolException
if the request contains a Cookie
header to prevent sensitive data leakage.ProtocolException
if the request contains a body.process
in interface org.apache.hc.core5.http.HttpRequestInterceptor
request
- The incoming HTTP request. Cannot be null
.entity
- Details of the request entity. Can be null
.context
- The HTTP context.org.apache.hc.core5.http.HttpException
- If a protocol error occurs.IOException
- If an I/O error occurs.Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.