public class CorsRegistration extends Object
CorsConfiguration mapped to one or more path patterns.
If no path pattern is specified, cross-origin request handling is mapped on "/**" .
By default, all origins, all headers, credentials and GET, HEAD, POST methods are allowed. Max age is set to 30 minutes.
| Constructor and Description |
|---|
CorsRegistration(String... pathPatterns) |
| Modifier and Type | Method and Description |
|---|---|
CorsRegistration |
allowCredentials(boolean allowCredentials) |
CorsRegistration |
allowedHeaders(String... headers) |
CorsRegistration |
allowedMethods(String... methods) |
CorsRegistration |
allowedOrigins(String... origins) |
CorsRegistration |
exposedHeaders(String... headers) |
protected org.springframework.web.cors.CorsConfiguration |
getCorsConfiguration() |
protected String[] |
getPathPatterns() |
CorsRegistration |
maxAge(long maxAge) |
public CorsRegistration(String... pathPatterns)
public CorsRegistration allowedOrigins(String... origins)
public CorsRegistration allowedMethods(String... methods)
public CorsRegistration allowedHeaders(String... headers)
public CorsRegistration exposedHeaders(String... headers)
public CorsRegistration maxAge(long maxAge)
public CorsRegistration allowCredentials(boolean allowCredentials)
protected String[] getPathPatterns()
protected org.springframework.web.cors.CorsConfiguration getCorsConfiguration()