spring-guides/gs-rest-service-cors

Spring Guide recommends to use obsolete method

imanushin opened this issue · 4 comments

See document https://spring.io/guides/gs/rest-service-cors/#_enabling_cors

Code below tries to use deprecated WebMvcConfigurerAdapter, instead of inline interface implementation:

    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:9000");
            }
        };
    }

This should be fixed by #19

This should be fixed by #19

Not fixed after almost 1 year, the guide still uses the deprecated WebMvcConfigurerAdapter.

#19 was never merged. Maybe one of the maintainers could have a look?