public class CorsConfig extends Object implements CorsConfiguration
CorsConfiguration which provides configuration of CORS in AeroGear Controller.CorsHandler| Modifier and Type | Class and Description |
|---|---|
private static class |
CorsConfig.Builder |
static interface |
CorsConfig.Cookies |
static interface |
CorsConfig.ExposeHeaders |
static interface |
CorsConfig.MaxAge |
static interface |
CorsConfig.Origin |
static interface |
CorsConfig.SupportedOptions |
static interface |
CorsConfig.ValidRequestHeaders |
static interface |
CorsConfig.ValidRequestMethods |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
allowCookies |
private boolean |
anyOrigin |
private boolean |
corsSupportEnabled |
private List<String> |
exposeHeaders |
private long |
maxAge |
private List<String> |
validRequestHeaders |
private Set<String> |
validRequestMethods |
| Modifier | Constructor and Description |
|---|---|
private |
CorsConfig(CorsConfig.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowCookies()
Determines if cookies are supported.
|
boolean |
anyOrigin()
Determines is any origin, "*", is supported.
|
static CorsConfiguration |
defaultConfig()
Returns a
CorsConfiguration instance with the default values for all properties. |
static CorsConfiguration |
disableCorsSupport() |
static CorsConfig.Origin |
enableCorsSupport()
Returns a
CorsConfig.Origin instance which can be configured as needed |
boolean |
exposeHeaders()
Determines if there are any headers configured to be exposed to calling clients.
|
List<String> |
getExposeHeaders()
Returns a comma separated string of headers to be exposed to calling clients.
|
long |
getMaxAge()
Gets the maxAge setting.
|
List<String> |
getValidRequestHeaders()
Returns the allowed set of Request Headers.
|
Set<String> |
getValidRequestMethods()
Returns the allowed set of Request Methods.
|
boolean |
hasMaxAge()
Determines is maxAge has been configured.
|
boolean |
isCorsSupportEnabled()
Determines is support for CORS is enabled.
|
String |
toString() |
private final boolean corsSupportEnabled
private final boolean anyOrigin
private final boolean allowCookies
private final long maxAge
private CorsConfig(CorsConfig.Builder builder)
public static CorsConfig.Origin enableCorsSupport()
CorsConfig.Origin instance which can be configured as neededCorsConfig.Origin to be used to configure and build a CorsConfiguration instance.public static CorsConfiguration disableCorsSupport()
public static CorsConfiguration defaultConfig()
CorsConfiguration instance with the default values for all properties.CorsConfiguration with default properties set.public boolean isCorsSupportEnabled()
CorsConfigurationisCorsSupportEnabled in interface CorsConfigurationtrue if support for CORS is enabled, false otherwise.public boolean exposeHeaders()
CorsConfigurationexposeHeaders in interface CorsConfigurationtrue if there are headers that should be exposed to clients.CorsConfiguration.getExposeHeaders()public List<String> getExposeHeaders()
CorsConfigurationgetExposeHeaders in interface CorsConfigurationString a comma separated string of headers to be exposed.public boolean anyOrigin()
CorsConfigurationanyOrigin in interface CorsConfigurationtrue if any origin is allowed.public boolean allowCookies()
CorsConfigurationallowCookies in interface CorsConfigurationtrue if cookies are supported.public boolean hasMaxAge()
CorsConfigurationhasMaxAge in interface CorsConfigurationtrue if maxAge has been set.CorsConfiguration.getMaxAge()public long getMaxAge()
CorsConfigurationgetMaxAge in interface CorsConfigurationlong the time in seconds that a preflight request may be cached.public Set<String> getValidRequestMethods()
CorsConfigurationgetValidRequestMethods in interface CorsConfigurationSet strings that represent the allowed Request Methods.public List<String> getValidRequestHeaders()
CorsConfigurationgetValidRequestHeaders in interface CorsConfigurationSet of strings that represent the allowed Request Headers.Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.