Package org.springframework.security.web.server.header

# Class ReferrerPolicyServerHttpHeadersWriter

java.lang.Object
org.springframework.security.web.server.header.ReferrerPolicyServerHttpHeadersWriter

All Implemented Interfaces:
  `ServerHttpHeadersWriter`

public final class ReferrerPolicyServerHttpHeadersWriter extends Object implements ServerHttpHeadersWriter
Writes the `Referrer-Policy` response header.

Since:
  5.1

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`ReferrerPolicyServerHttpHeadersWriter.ReferrerPolicy`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`REFERRER_POLICY`

## Constructor Summary

Constructors
Constructor
Description
`ReferrerPolicyServerHttpHeadersWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setPolicy(ReferrerPolicyServerHttpHeadersWriter.ReferrerPolicy policy)`
Set the policy to be used in the response header.
`reactor.core.publisher.Mono<Void>`
`writeHttpHeaders(org.springframework.web.server.ServerWebExchange exchange)`
Write the headers to the response.

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

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

## Field Details

### REFERRER_POLICY

public static final String REFERRER_POLICY

See Also:
  - Constant Field Values

## Constructor Details

### ReferrerPolicyServerHttpHeadersWriter

public ReferrerPolicyServerHttpHeadersWriter()

## Method Details

### writeHttpHeaders

public reactor.core.publisher.Mono<Void> writeHttpHeaders(org.springframework.web.server.ServerWebExchange exchange)
Description copied from interface: `ServerHttpHeadersWriter`
Write the headers to the response.

Specified by:
  `writeHttpHeaders` in interface `ServerHttpHeadersWriter`
Returns:
  A Mono which is returned to the `Supplier` of the `ReactiveHttpOutputMessage.beforeCommit(Supplier)`.

### setPolicy

public void setPolicy(ReferrerPolicyServerHttpHeadersWriter.ReferrerPolicy policy)
Set the policy to be used in the response header.

Parameters:
  `policy` - the policy
Throws:
  `IllegalArgumentException` - if policy is `null`