headers

fun headers(headersConfiguration: ServerHeadersDsl.() -> Unit)

Allows configuring response headers.

Example:

@Configuration
@EnableWebFluxSecurity
class SecurityConfig {

@Bean
fun springWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
headers {
referrerPolicy {
policy = ReferrerPolicy.SAME_ORIGIN
}
frameOptions {
mode = Mode.DENY
}
}
}
}
}

Parameters

headersConfiguration

custom configuration to be applied to the response headers

See also