Package org.restheart.handlers.injectors
Class DateHeader
java.lang.Object
org.restheart.handlers.injectors.DateHeader
- All Implemented Interfaces:
ConfigurablePlugin,ExchangeTypeResolver<ServiceRequest<?>,,ServiceResponse<?>> Interceptor<ServiceRequest<?>,,ServiceResponse<?>> Plugin,WildcardInterceptor
Sets the Date response header
According to the HTTP specification, the `Date` header should be included in all responses,
except when the server lacks an accurate clock.
In Undertow, the `Date` header is added via
ThreadLocal<SimpleDateFormat>.
However, this approach is not optimal for virtual threads.- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(ServiceRequest<?> request, ServiceResponse<?> response) booleanresolve(ServiceRequest<?> request, ServiceResponse<?> response) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.restheart.plugins.ConfigurablePlugin
arg, argOrDefaultMethods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
Constructor Details
-
DateHeader
public DateHeader()
-
-
Method Details
-
handle
- Specified by:
handlein interfaceInterceptor<ServiceRequest<?>,ServiceResponse<?>> - Throws:
Exception
-
resolve
- Specified by:
resolvein interfaceInterceptor<ServiceRequest<?>,ServiceResponse<?>>
-