public class CorsRegistry extends Object
CorsRegistry
assists with the registration of CorsConfiguration
mapped to a path pattern.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.
pathPattern
- the path pattern to enable CORS handling forprotected Map<String,CorsConfiguration> getCorsConfigurations()
CorsConfiguration
objects,
keyed by path pattern.