public class CorsRegistration
extends java.lang.Object
CorsRegistration assists with the creation of a
CorsConfiguration instance mapped to a path pattern.
If no path pattern is specified, cross-origin request handling is
mapped to "/**".
By default, all origins, all headers, credentials and GET,
HEAD, and POST methods are allowed, and the max age is
set to 30 minutes.
CorsConfiguration,
CorsRegistry| Constructor and Description |
|---|
CorsRegistration(java.lang.String pathPattern) |
| Modifier and Type | Method and Description |
|---|---|
CorsRegistration |
allowCredentials(boolean allowCredentials) |
CorsRegistration |
allowedHeaders(java.lang.String... headers) |
CorsRegistration |
allowedMethods(java.lang.String... methods) |
CorsRegistration |
allowedOrigins(java.lang.String... origins) |
CorsRegistration |
exposedHeaders(java.lang.String... headers) |
protected CorsConfiguration |
getCorsConfiguration() |
protected java.lang.String |
getPathPattern() |
CorsRegistration |
maxAge(long maxAge) |
public CorsRegistration allowedOrigins(java.lang.String... origins)
public CorsRegistration allowedMethods(java.lang.String... methods)
public CorsRegistration allowedHeaders(java.lang.String... headers)
public CorsRegistration exposedHeaders(java.lang.String... headers)
public CorsRegistration maxAge(long maxAge)
public CorsRegistration allowCredentials(boolean allowCredentials)
protected java.lang.String getPathPattern()
protected CorsConfiguration getCorsConfiguration()