public class CorsRegistry extends Object
CorsConfiguration mappings.CorsRegistration| Constructor and Description |
|---|
CorsRegistry() |
| Modifier and Type | Method and Description |
|---|---|
CorsRegistration |
addMapping(String pathPattern)
Enable cross-origin request handling for the specified path pattern.
|
protected Map<String,CorsConfiguration> |
getCorsConfigurations()
Return the registered
CorsConfiguration objects,
keyed by path pattern. |
public CorsRegistration addMapping(String pathPattern)
Exact path mapping URIs (such as "/admin") are supported as
well as Ant-style path patterns (such as "/admin/**").
By default, all origins, all headers, credentials and GET,
HEAD, and POST methods are allowed, and the max age
is set to 30 minutes.
The following defaults are applied to the CorsRegistration:
GET, HEAD and POST.protected Map<String,CorsConfiguration> getCorsConfigurations()
CorsConfiguration objects,
keyed by path pattern.