@Contract(threading=SAFE) public class ResponseDate extends Object implements HttpResponseInterceptor
Date header
to outgoing response messages.
This interceptor is recommended for the HTTP protocol conformance and the correct operation of the server-side message processing pipeline.
If the Date header is missing or considered invalid, and the
alwaysReplace flag is set to true, the interceptor will replace it
with the current system date and time.
| Modifier and Type | Field and Description |
|---|---|
static ResponseDate |
INSTANCE |
| Constructor and Description |
|---|
ResponseDate() |
ResponseDate(boolean alwaysReplace)
Constructs a ResponseDate interceptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
process(HttpResponse response,
EntityDetails entity,
HttpContext context)
Processes a response.
|
public static final ResponseDate INSTANCE
public ResponseDate()
public ResponseDate(boolean alwaysReplace)
alwaysReplace - Whether to replace an invalid Date header.
If true, the interceptor will replace any
detected invalid Date header with a valid value.public void process(HttpResponse response, EntityDetails entity, HttpContext context) throws HttpException, IOException
HttpResponseInterceptorprocess in interface HttpResponseInterceptorresponse - the response to processentity - the request entity details or null if not availablecontext - the context for the requestHttpException - in case of an HTTP protocol violationIOException - in case of an I/O errorCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.