Package org.springframework.security.config.annotation.web.configurers

# Class HeadersConfigurer.ReferrerPolicyConfig

java.lang.Object
org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.ReferrerPolicyConfig

Enclosing class:
  HeadersConfigurer<H extends HttpSecurityBuilder<H>>

public final class HeadersConfigurer.ReferrerPolicyConfig extends Object

## Method Summary

Modifier and Type
Method
Description
`HeadersConfigurer<H>`
`and()`
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0.
`HeadersConfigurer<H>.ReferrerPolicyConfig`
`policy(org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter.ReferrerPolicy policy)`
Sets the policy to be used in the response header.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### policy

public HeadersConfigurer<H>.ReferrerPolicyConfig policy(org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter.ReferrerPolicy policy)
Sets the policy to be used in the response header.

Parameters:
  `policy` - a referrer policy
Returns:
  the `HeadersConfigurer<H extends HttpSecurityBuilder<H>>.ReferrerPolicyConfig` for additional configuration
Throws:
  `IllegalArgumentException` - if policy is null

### and

@Deprecated(since="6.1", forRemoval=true) public HeadersConfigurer<H> and()
Deprecated, for removal: This API element is subject to removal in a future version.
For removal in 7.0. Use `HeadersConfigurer.referrerPolicy(Customizer)` or `referrerPolicy(Customizer.withDefaults())` to stick with defaults. See the documentation for more details.