public final class CorsConfig extends Object
Modifier and Type | Method and Description |
---|---|
Set<String> |
allowedRequestHeaders()
Returns the allowed set of Request Headers.
|
Set<org.jboss.netty.handler.codec.http.HttpMethod> |
allowedRequestMethods()
Returns the allowed set of Request Methods.
|
boolean |
isAnyOriginSupported()
Determines whether a wildcard origin, '*', is supported.
|
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.
|
boolean |
isOriginAllowed(String origin)
Returns whether the input origin is allowed by this configuration.
|
boolean |
isShortCircuit()
Determines whether a CORS request should be rejected if it's invalid before being
further processing.
|
long |
maxAge()
Gets the maxAge setting.
|
Set<String> |
origins()
Returns the set of allowed origins.
|
org.jboss.netty.handler.codec.http.HttpHeaders |
preflightResponseHeaders()
Returns HTTP response headers that should be added to a CORS preflight response.
|
String |
toString() |
public boolean isCorsSupportEnabled()
true
if support for CORS is enabled, false otherwise.public boolean isAnyOriginSupported()
boolean
true if any origin is allowed.public Set<String> origins()
Set
the allowed origins.public boolean isOriginAllowed(String origin)
true
if the origin is allowed, otherwise false
public boolean isNullOriginAllowed()
true
if a 'null' origin should be supported.public boolean isCredentialsAllowed()
xhr.withCredentials = true;The default value for 'withCredentials' is false in which case no cookies are sent. Settning this to true will included cookies in cross origin requests.
true
if cookies are supported.public long maxAge()
long
the time in seconds that a preflight request may be cached.public Set<org.jboss.netty.handler.codec.http.HttpMethod> allowedRequestMethods()
Set
of HttpMethod
s that represent the allowed Request Methods.public Set<String> allowedRequestHeaders()
Set<String>
of strings that represent the allowed Request Headers.public org.jboss.netty.handler.codec.http.HttpHeaders preflightResponseHeaders()
HttpHeaders
the HTTP response headers to be added.public boolean isShortCircuit()
true
if a CORS request should short-curcuit upon receiving an invalid Origin header.Copyright © 2009–2016. All rights reserved.