public class CORSConfigurationBuilder extends AbstractPathConfigurationChildBuilder
Modifier and Type | Method and Description |
---|---|
CORSConfigurationBuilder |
allowAll()
Convenience method to still use CORS but disable validations by allowing everything.
|
CORSConfigurationBuilder |
allowAnyHeader(boolean allowAnyHeader)
Use this method to indicate that any HTTP header is allowed for a specific path.
|
CORSConfigurationBuilder |
allowAnyMethod(boolean allowAnyMethod)
Use this method to indicate that any HTTP method is allowed for a specific path.
|
CORSConfigurationBuilder |
allowAnyOrigin(boolean allowAnyOrigin)
Use this method to indicate that any origin is allowed to access a specific path.
|
CORSConfigurationBuilder |
allowCredentials(boolean allowCredentials)
Use this method to indicate that the actual request can include user credentials.
|
CORSConfigurationBuilder |
allowHeaders(String... allowedHeaders)
Use this method to specify the HTTP headers allowed to access a specific path.
|
CORSConfigurationBuilder |
allowMethods(String... allowedMethods)
Use this method to specify the HTTP methods allowed to access a specific path.
|
CORSConfigurationBuilder |
allowOrigins(String... allowedOrigins)
Use this method to specify the origins allowed to access a specific path.
|
CORSConfigurationBuilder |
exposedHeaders(String... exposedHeaders)
Use this method to specify which HTTP headers must be exposed to clients (eg.: XMLHttpRequest)
in addition to the default ones, as defined by the specification.
|
CORSConfigurationBuilder |
maxAge(long maxAge)
Use this method to indicate indicates how long the results of a preflight request can be cached.
|
authenticateWith, authorizeWith, cors, getBuilder, redirectTo, unprotected
allPaths, forGroup, forPath, forPath, restrictive
build, create, http, identity, idmConfig, readFrom, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allPaths, forGroup, forPath, forPath, restrictive
build, http, identity, idmConfig
public CORSConfigurationBuilder allowOrigins(String... allowedOrigins)
Use this method to specify the origins allowed to access a specific path.
allowedOrigins
- A single string or an array of allowed origins.public CORSConfigurationBuilder allowMethods(String... allowedMethods)
Use this method to specify the HTTP methods allowed to access a specific path.
allowedMethods
- A single string or an array of HTTP methods.public CORSConfigurationBuilder allowHeaders(String... allowedHeaders)
Use this method to specify the HTTP headers allowed to access a specific path.
allowedHeaders
- A single string or an array of HTTP headers.public CORSConfigurationBuilder exposedHeaders(String... exposedHeaders)
Use this method to specify which HTTP headers must be exposed to clients (eg.: XMLHttpRequest) in addition to the default ones, as defined by the specification.
exposedHeaders
- A single string or an array of HTTP headers.public CORSConfigurationBuilder allowCredentials(boolean allowCredentials)
Use this method to indicate that the actual request can include user credentials.
allowCredentials
- True if credentials are allowed. Otherwise, set to false. Defaults to false.public CORSConfigurationBuilder allowAnyOrigin(boolean allowAnyOrigin)
Use this method to indicate that any origin is allowed to access a specific path.
allowAnyOrigin
- Defaults to false.public CORSConfigurationBuilder allowAnyHeader(boolean allowAnyHeader)
Use this method to indicate that any HTTP header is allowed for a specific path.
allowAnyHeader
- Defaults to false.public CORSConfigurationBuilder allowAnyMethod(boolean allowAnyMethod)
Use this method to indicate that any HTTP method is allowed for a specific path.
allowAnyMethod
- Defaults to false.public CORSConfigurationBuilder allowAll()
Convenience method to still use CORS but disable validations by allowing everything.
public CORSConfigurationBuilder maxAge(long maxAge)
Use this method to indicate indicates how long the results of a preflight request can be cached.
maxAge
- An interget number of seconds.Copyright © 2019. All rights reserved.