Top Description Fields Constructors Methods
org.springframework.web.servlet.config.annotation

public Class CorsRegistry

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Map, org.springframework.util.CollectionUtils, org.springframework.web.cors.CorsConfiguration

Assists with the registration of global, URL pattern based CorsConfiguration mappings.
Authors
Sebastien Deleuze, Rossen Stoyanchev
Since
4.2
See Also
CorsRegistration

Field Summary

Modifier and TypeField and Description
private final List<CorsRegistration>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

registrationsback to summary
private final List<CorsRegistration> registrations

Constructor Detail

CorsRegistryback to summary
public CorsRegistry()

Method Detail

addMappingback to summary
public CorsRegistration addMapping(String pathPattern)

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 in CorsConfiguration#applyPermitDefaultValues().

getCorsConfigurationsback to summary
protected Map<String, CorsConfiguration> getCorsConfigurations()

Return the registered CorsConfiguration objects, keyed by path pattern.