Polish CORS global configuration

This commit introduces the following changes:
 - configureCors(CorsConfigurer configurer) is renamed to
   addCorsMappings(CorsRegistry registry)
 - enableCors(String... pathPatterns) is renamed to
   addMapping(String pathPattern)
 - <cors /> element must have at least one <mapping /> child
   element in order to be consistent with XML based configuration
   and have more explicit configuration

Issues: SPR-12933, SPR-13046
This commit is contained in:
Sebastien Deleuze
2015-06-05 16:10:29 +02:00
parent e8441edcb7
commit 0c3b34f7d5
11 changed files with 48 additions and 61 deletions

View File

@@ -1237,17 +1237,15 @@
<xsd:element name="cors">
<xsd:annotation>
<xsd:documentation><![CDATA[
Configure cross origin requests handling.
By default, all origins, GET HEAD POST methods, all headers and credentials
are allowed and max age is set to 30 minutes.
Configure cross origin requests processing.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="mapping" minOccurs="0" maxOccurs="unbounded">
<xsd:element name="mapping" minOccurs="1" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation><![CDATA[
Enable cross origin requests handling on the specified path patterns.
Enable cross origin requests processing on the specified path pattern.
By default, all origins, GET HEAD POST methods, all headers and credentials
are allowed and max age is set to 30 minutes.
]]></xsd:documentation>