headers
Allows configuring response headers.
Example:
@Configuration
@EnableWebSecurity
class SecurityConfig {
@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http {
headers {
referrerPolicy {
policy = ReferrerPolicy.SAME_ORIGIN
}
}
}
return http.build()
}
}Content copied to clipboard
Parameters
headersConfiguration
custom configurations to configure the response headers