DATAREST-1543 - Deprecate RepositoryRestConfiguration.getCorsRegistry().
Slightly tweaked the configuration model to rather handle the CorsRegistry via RepositoryRestConfigurer.configureRepositoryRestConfiguration(…) rather than RepositoryRestConfiguration itself. That allows moving of Spring WebMVC as a dependency in the core module. The original methods exposing access to the CorsRegistry are now still available in deprecated form to not break existing clients. Follow-up ticket: DATAREST-1542.
This commit is contained in:
@@ -51,9 +51,9 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
|
||||
@Bean
|
||||
RepositoryRestConfigurer repositoryRestConfigurer() {
|
||||
|
||||
return RepositoryRestConfigurer.withConfig(config -> {
|
||||
return RepositoryRestConfigurer.withConfig((config, cors) -> {
|
||||
|
||||
config.getCorsRegistry().addMapping("/books/**") //
|
||||
cors.addMapping("/books/**") //
|
||||
.allowedMethods("GET", "PUT", "POST") //
|
||||
.allowedOrigins("http://far.far.example");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user