Class CorsRegistry
java.lang.Object
org.springframework.web.servlet.config.annotation.CorsRegistry
Assists with the registration of global, URL pattern based
CorsConfiguration
mappings.- Since:
- 4.2
- Author:
- Sebastien Deleuze, Rossen Stoyanchev
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddMapping
(String pathPattern) Enable cross-origin request handling for the specified path pattern.protected Map<String,
CorsConfiguration> Return the registeredCorsConfiguration
objects, keyed by path pattern.
-
Constructor Details
-
CorsRegistry
public CorsRegistry()
-
-
Method Details
-
addMapping
Enable cross-origin request handling for the specified path pattern.Exact path mapping URIs (such as
"/admin"
) are supported as well as Ant-style path patterns (such as"/admin/**"
).By default, the
CorsConfiguration
for this mapping is initialized with default values as described inCorsConfiguration.applyPermitDefaultValues()
. -
getCorsConfigurations
Return the registeredCorsConfiguration
objects, keyed by path pattern.
-