Build and Test Reactive Microservices with Spring Cloud Gateway

Matt Raible

Hello Lakshyajit - I tested the CORS settings today and found issues. If you use the following for the CORS bean, it should work.


@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration corsConfig = new CorsConfiguration();
corsConfig.setAllowedOrigins(List.of(""));
corsConfig.setMaxAge(3600L);
corsConfig.addAllowedMethod("
");
corsConfig.addAllowedHeader("*");

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", corsConfig);
return source;
}

I updated this post with these changes and added a changelog at the bottom with links to pull requests.