Package org.springframework.security.web.header.writers

# Class CrossOriginResourcePolicyHeaderWriter

java.lang.Object
org.springframework.security.web.header.writers.CrossOriginResourcePolicyHeaderWriter

All Implemented Interfaces:
  `HeaderWriter`

public final class CrossOriginResourcePolicyHeaderWriter extends Object implements HeaderWriter
Inserts Cross-Origin-Resource-Policy header

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

## Nested Class Summary

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

## Constructor Summary

Constructors
Constructor
Description
`CrossOriginResourcePolicyHeaderWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setPolicy(CrossOriginResourcePolicyHeaderWriter.CrossOriginResourcePolicy resourcePolicy)`
Sets the `CrossOriginResourcePolicyHeaderWriter.CrossOriginResourcePolicy` value to be used in the `Cross-Origin-Resource-Policy` header
`void`
`writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)`
Create a `Header` instance.

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

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

## Constructor Details

### CrossOriginResourcePolicyHeaderWriter

public CrossOriginResourcePolicyHeaderWriter()

## Method Details

### setPolicy

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

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

### writeHeaders

public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
Description copied from interface: `HeaderWriter`
Create a `Header` instance.

Specified by:
  `writeHeaders` in interface `HeaderWriter`
Parameters:
  `request` - the request
  `response` - the response