public class CorsRegistry
extends java.lang.Object
CorsRegistry
assists with the registration of CorsConfiguration
mapped to a path pattern.CorsRegistration
Modifier and Type | Field and Description |
---|---|
private java.util.List<CorsRegistration> |
registrations |
Constructor and Description |
---|
CorsRegistry() |
Modifier and Type | Method and Description |
---|---|
CorsRegistration |
addMapping(java.lang.String pathPattern)
Enable cross-origin request handling for the specified path pattern.
|
protected java.util.Map<java.lang.String,CorsConfiguration> |
getCorsConfigurations()
Return the registered
CorsConfiguration objects,
keyed by path pattern. |
private final java.util.List<CorsRegistration> registrations
public CorsRegistration addMapping(java.lang.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 java.util.Map<java.lang.String,CorsConfiguration> getCorsConfigurations()
CorsConfiguration
objects,
keyed by path pattern.