cors

fun cors(corsConfiguration: ServerCorsDsl.() -> Unit)

Allows configuring CORS.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
cors {
configurationSource = customConfigurationSource
}
}
}
}

Parameters

corsConfiguration

custom configuration to be applied to the CORS headers

See also