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

# Class CrossOriginOpenerPolicyHeaderWriter

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

All Implemented Interfaces:
  `HeaderWriter`

public final class CrossOriginOpenerPolicyHeaderWriter extends Object implements HeaderWriter
Inserts the Cross-Origin-Opener-Policy header

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy`

## Constructor Summary

Constructors
Constructor
Description
`CrossOriginOpenerPolicyHeaderWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setPolicy(CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy openerPolicy)`
Sets the `CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy` value to be used in the `Cross-Origin-Opener-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

### CrossOriginOpenerPolicyHeaderWriter

public CrossOriginOpenerPolicyHeaderWriter()

## Method Details

### setPolicy

public void setPolicy(CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy openerPolicy)
Sets the `CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy` value to be used in the `Cross-Origin-Opener-Policy` header

Parameters:
  `openerPolicy` - the `CrossOriginOpenerPolicyHeaderWriter.CrossOriginOpenerPolicy` 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