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

# Class CrossOriginResourcePolicyServerHttpHeadersWriter

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

All Implemented Interfaces:
  `ServerHttpHeadersWriter`

public final class CrossOriginResourcePolicyServerHttpHeadersWriter extends Object implements ServerHttpHeadersWriter
Inserts Cross-Origin-Resource-Policy headers.

Since:
  5.7
See Also:
  - Cross-Origin-Resource-Policy

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy`

## Field Summary

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

## Constructor Summary

Constructors
Constructor
Description
`CrossOriginResourcePolicyServerHttpHeadersWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setPolicy(CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy resourcePolicy)`
Sets the `CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy` value to be used in the `Cross-Origin-Embedder-Policy` 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

### RESOURCE_POLICY

public static final String RESOURCE_POLICY

See Also:
  - Constant Field Values

## Constructor Details

### CrossOriginResourcePolicyServerHttpHeadersWriter

public CrossOriginResourcePolicyServerHttpHeadersWriter()

## Method Details

### setPolicy

public void setPolicy(CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy resourcePolicy)
Sets the `CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy` value to be used in the `Cross-Origin-Embedder-Policy` header

Parameters:
  `resourcePolicy` - the `CrossOriginResourcePolicyServerHttpHeadersWriter.CrossOriginResourcePolicy` to use

### 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)`.