public final class CorsConfig extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CorsConfig.Builder |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
allowedRequestHeaders()
Returns the allowed set of Request Headers.
|
Set<HttpMethod> |
allowedRequestMethods()
Returns the allowed set of Request Methods.
|
static CorsConfig.Builder |
anyOrigin() |
Set<String> |
exposedHeaders()
Returns a set of headers to be exposed to calling clients.
|
boolean |
isCorsSupportEnabled()
Determines if support for CORS is enabled.
|
boolean |
isCredentialsAllowed()
Determines if cookies are supported for CORS requests.
|
boolean |
isNullOriginAllowed()
Web browsers may set the 'Origin' request header to 'null' if a resource is loaded
from the local file system.
|
long |
maxAge()
Gets the maxAge setting.
|
String |
origin()
Returns the allowed origin.
|
String |
toString() |
static CorsConfig.Builder |
withOrigin(String origin) |
public boolean isCorsSupportEnabled()
true if support for CORS is enabled, false otherwise.public String origin()
public boolean isNullOriginAllowed()
true if a 'null' origin should be supported.public Set<String> exposedHeaders()
xhr.getResponseHeader("Content-Type");
The headers that are available by default are:
List<String> a list of the headers to expose.public boolean isCredentialsAllowed()
true if cookies are supported.public long maxAge()
long the time in seconds that a preflight request may be cached.public Set<HttpMethod> allowedRequestMethods()
Set strings that represent the allowed Request Methods.public Set<String> allowedRequestHeaders()
Set of strings that represent the allowed Request Headers.public static CorsConfig.Builder anyOrigin()
public static CorsConfig.Builder withOrigin(String origin)
Copyright © 2008–2014 The Netty Project. All rights reserved.