public interface CorsHandler extends Handler<RoutingContext>
| Modifier and Type | Method and Description | 
|---|---|
CorsHandler | 
allowCredentials(boolean allow)
Set whether credentials are allowed. 
 | 
CorsHandler | 
allowedHeader(String headerName)
Add an allowed header 
 | 
CorsHandler | 
allowedHeaders(Set<String> headerNames)
Add a set of allowed headers 
 | 
CorsHandler | 
allowedMethod(HttpMethod method)
Add an allowed method 
 | 
CorsHandler | 
allowedMethods(Set<HttpMethod> methods)
Add a set of  allowed methods 
 | 
static CorsHandler | 
create(String allowedOriginPattern)
Create a CORS handler 
 | 
CorsHandler | 
exposedHeader(String headerName)
Add an exposed header 
 | 
CorsHandler | 
exposedHeaders(Set<String> headerNames)
Add a set of exposed headers 
 | 
CorsHandler | 
maxAgeSeconds(int maxAgeSeconds)
Set how long the browser should cache the information 
 | 
static CorsHandler create(String allowedOriginPattern)
allowedOriginPattern - the allowed origin patternCorsHandler allowedMethod(HttpMethod method)
method - the method to addCorsHandler allowedMethods(Set<HttpMethod> methods)
methods - the methods to addCorsHandler allowedHeader(String headerName)
headerName - the allowed header nameCorsHandler allowedHeaders(Set<String> headerNames)
headerNames - the allowed header namesCorsHandler exposedHeader(String headerName)
headerName - the exposed header nameCorsHandler exposedHeaders(Set<String> headerNames)
headerNames - the exposed header namesCorsHandler allowCredentials(boolean allow)
Important note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding.
allow - true if allowedCorsHandler maxAgeSeconds(int maxAgeSeconds)
maxAgeSeconds - max age in secondsCopyright © 2020 Eclipse. All rights reserved.