We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CorsRegistration#combine
The call to CorsConfiguration::combine returns a new configuration object, which is ignored.
CorsConfiguration::combine
spring-framework/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java
Lines 151 to 154 in 607d918
spring-framework/spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java
Lines 479 to 501 in 607d918
Affects: 5.3
I was expecting the following to work:
@Configuration class CorsGlobalConfiguration : WebFluxConfigurer { override fun addCorsMappings(corsRegistry: CorsRegistry) { val config = CorsConfiguration() config.addAllowedOrigin("http://localhost:3000") config.addAllowedMethod("*") config.applyPermitDefaultValues() corsRegistry.addMapping("/api/**").combine(config) } }
This works:
@Configuration class CorsGlobalConfiguration : WebFluxConfigurer { override fun addCorsMappings(corsRegistry: CorsRegistry) { corsRegistry.addMapping("/api/**") .allowedOrigins("http://localhost:3000") .allowedMethods("*") } }
The text was updated successfully, but these errors were encountered:
Thanks for bringing this to our attention... as your first issue raised against the Spring Framework!
This applies to both Web MVC and WebFlux:
org.springframework.web.reactive.config.CorsRegistration.combine(CorsConfiguration)
org.springframework.web.servlet.config.annotation.CorsRegistration.combine(CorsConfiguration)
See also: #25716
Sorry, something went wrong.
443c34c
CorsRegistration::combine
CorsRegistry implements combine correctly
f38d3d7
Closes spring-projectsgh-26877
656962f
rstoyanchev
No branches or pull requests
The call to
CorsConfiguration::combine
returns a new configuration object, which is ignored.spring-framework/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java
Lines 151 to 154 in 607d918
spring-framework/spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java
Lines 479 to 501 in 607d918
Affects: 5.3
I was expecting the following to work:
This works:
The text was updated successfully, but these errors were encountered: