public final class Netty4CorsConfig
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<java.lang.String> |
allowedRequestHeaders() |
Returns the allowed set of Request Headers.
|
java.util.Set<io.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(java.lang.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.
|
java.util.Optional<java.util.Set<java.lang.String>> |
origins() |
Returns the set of allowed origins.
|
io.netty.handler.codec.http.HttpHeaders |
preflightResponseHeaders() |
Returns HTTP response headers that should be added to a CORS preflight response.
|
java.lang.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 java.util.Optional<java.util.Set<java.lang.String>> origins()
Set the allowed origins.public boolean isOriginAllowed(java.lang.String origin)
true if the origin is allowed, otherwise falsepublic 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. Setting 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 java.util.Set<io.netty.handler.codec.http.HttpMethod> allowedRequestMethods()
Set of HttpMethods that represent the allowed Request Methods.public java.util.Set<java.lang.String> allowedRequestHeaders()
Set<String> of strings that represent the allowed Request Headers.public io.netty.handler.codec.http.HttpHeaders preflightResponseHeaders()
HttpHeaders the HTTP response headers to be added.public boolean isShortCircuit()
true if a CORS request should short-circuit upon receiving an invalid Origin header.public java.lang.String toString()
toString in class java.lang.Object