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

@@ -6,7 +6,9 @@
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- <mvc:cors /> element before <mvc:annotation-driven /> one -->
<mvc:cors />
<mvc:cors>
<mvc:mapping path="/**" />
</mvc:cors>
<mvc:annotation-driven />