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

# Class XContentTypeOptionsServerHttpHeadersWriter

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

All Implemented Interfaces:
  `ServerHttpHeadersWriter`

public class XContentTypeOptionsServerHttpHeadersWriter extends Object implements ServerHttpHeadersWriter
Adds X-Content-Type-Options: nosniff

Since:
  5.0

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NOSNIFF`
`static final String`
`X_CONTENT_OPTIONS`

## Constructor Summary

Constructors
Constructor
Description
`XContentTypeOptionsServerHttpHeadersWriter()`

## Method Summary

Modifier and Type
Method
Description
`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_CONTENT_OPTIONS

public static final String X_CONTENT_OPTIONS

See Also:
  - Constant Field Values

### NOSNIFF

public static final String NOSNIFF

See Also:
  - Constant Field Values

## Constructor Details

### XContentTypeOptionsServerHttpHeadersWriter

public XContentTypeOptionsServerHttpHeadersWriter()

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