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

# Class XFrameOptionsServerHttpHeadersWriter

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

All Implemented Interfaces:
  `ServerHttpHeadersWriter`

public class XFrameOptionsServerHttpHeadersWriter extends Object implements ServerHttpHeadersWriter
`ServerHttpHeadersWriter` implementation for the X-Frame-Options headers.

Since:
  5.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`XFrameOptionsServerHttpHeadersWriter.Mode`
The X-Frame-Options values.

## Field Summary

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

## Constructor Summary

Constructors
Constructor
Description
`XFrameOptionsServerHttpHeadersWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setMode(XFrameOptionsServerHttpHeadersWriter.Mode mode)`
Sets the X-Frame-Options mode.
`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

### X_FRAME_OPTIONS

public static final String X_FRAME_OPTIONS

See Also:
  - Constant Field Values

## Constructor Details

### XFrameOptionsServerHttpHeadersWriter

public XFrameOptionsServerHttpHeadersWriter()

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

### setMode

public void setMode(XFrameOptionsServerHttpHeadersWriter.Mode mode)
Sets the X-Frame-Options mode. There is no support for ALLOW-FROM because not all browsers support it. Consider using X-Frame-Options with Content-Security-Policy frame-ancestors.

Parameters:
  `mode` -