Thanks!
See https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#cors !
For me your solution worked too, the same:
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedMethods("POST", "GET", "PUT", "DELETE", "HEAD")
.allowedOrigins("*")
.allowCredentials(false);
}
};
}
As described in https://spring.io/guides/gs/rest-service-cors/ -
section ‘Global CORS configuration’.