@Contract(threading=IMMUTABLE) public class RequestTE extends Object implements HttpRequestInterceptor
HttpHeaders.TE header field in HTTP/1.1 requests.
The HttpHeaders.TE header is used to indicate transfer codings the client is willing to accept and, in some cases, whether
the client is willing to accept trailer fields. This interceptor ensures that the HttpHeaders.TE header does not include
the chunked transfer coding and validates the presence of the Connection: TE header.
For HTTP/1.1 requests, the HttpHeaders.TE header can contain multiple values separated by commas and may include quality
values (denoted by q=) separated by semicolons.
In case of HTTP/2, this validation is skipped, and another layer of logic handles the specifics of HTTP/2 compliance.
| Modifier and Type | Field and Description |
|---|---|
static HttpRequestInterceptor |
INSTANCE
Singleton instance of the
RequestTE interceptor. |
| Constructor and Description |
|---|
RequestTE()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
process(HttpRequest request,
EntityDetails entity,
HttpContext context)
Processes the
TE header of the given HTTP request and ensures compliance with HTTP/1.1 requirements. |
public static final HttpRequestInterceptor INSTANCE
RequestTE interceptor.public void process(HttpRequest request, EntityDetails entity, HttpContext context) throws HttpException, IOException
TE header of the given HTTP request and ensures compliance with HTTP/1.1 requirements.
If the TE header is present, this method validates that:
TE header does not include the chunked transfer coding, which is implicitly supported for HTTP/1.1.Connection header includes the TE directive, as required by the protocol.process in interface HttpRequestInterceptorrequest - the HTTP request containing the headers to validateentity - the entity associated with the request (may be null)context - the execution context for the requestHttpException - if the TE header contains invalid values or the Connection header is missingIOException - in case of an I/O errorCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.