Class TokenCORSResponseInterceptor
- java.lang.Object
-
- org.restheart.security.plugins.interceptors.TokenCORSResponseInterceptor
-
- All Implemented Interfaces:
BsonInterceptor,ConfigurablePlugin,ExchangeTypeResolver<BsonRequest,BsonResponse>,Interceptor<BsonRequest,BsonResponse>,Plugin
public class TokenCORSResponseInterceptor extends Object implements BsonInterceptor
helper interceptor to add token headers to Access-Control-Expose-Headers to handle CORS request- Author:
- Andrea Di Cesare
-
-
Constructor Summary
Constructors Constructor Description TokenCORSResponseInterceptor()TokenCORSResponseInterceptor(String... headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(BsonRequest request, BsonResponse response)booleanresolve(BsonRequest request, BsonResponse response)voidsetHeaders(String[] headers)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
-
-
-
Constructor Detail
-
TokenCORSResponseInterceptor
public TokenCORSResponseInterceptor()
-
TokenCORSResponseInterceptor
public TokenCORSResponseInterceptor(String... headers)
-
-
Method Detail
-
handle
public void handle(BsonRequest request, BsonResponse response) throws Exception
- Specified by:
handlein interfaceInterceptor<BsonRequest,BsonResponse>- Throws:
Exception
-
resolve
public boolean resolve(BsonRequest request, BsonResponse response)
- Specified by:
resolvein interfaceInterceptor<BsonRequest,BsonResponse>
-
setHeaders
public void setHeaders(String[] headers)
- Parameters:
headers- the headers to set
-
-