Package org.springframework.security.web.server.firewall

# Class HttpStatusExchangeRejectedHandler

java.lang.Object
org.springframework.security.web.server.firewall.HttpStatusExchangeRejectedHandler

All Implemented Interfaces:
  `ServerExchangeRejectedHandler`

public class HttpStatusExchangeRejectedHandler extends Object implements ServerExchangeRejectedHandler
A simple implementation of `ServerExchangeRejectedHandler` that sends an error with configurable status code.

Since:
  6.4

## Constructor Summary

Constructors
Constructor
Description
`HttpStatusExchangeRejectedHandler()`
Constructs an instance which uses `400` as response code.
`HttpStatusExchangeRejectedHandler(org.springframework.http.HttpStatus status)`
Constructs an instance which uses a configurable http code as response.

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Void>`
`handle(org.springframework.web.server.ServerWebExchange exchange, ServerExchangeRejectedException serverExchangeRejectedException)`
Handles an request rejected failure.

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

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

## Constructor Details

### HttpStatusExchangeRejectedHandler

public HttpStatusExchangeRejectedHandler()
Constructs an instance which uses `400` as response code.

### HttpStatusExchangeRejectedHandler

public HttpStatusExchangeRejectedHandler(org.springframework.http.HttpStatus status)
Constructs an instance which uses a configurable http code as response.

Parameters:
  `status` - http status code to use

## Method Details

### handle

public reactor.core.publisher.Mono<Void> handle(org.springframework.web.server.ServerWebExchange exchange, ServerExchangeRejectedException serverExchangeRejectedException)
Description copied from interface: `ServerExchangeRejectedHandler`
Handles an request rejected failure.

Specified by:
  `handle` in interface `ServerExchangeRejectedHandler`
Parameters:
  `exchange` - the `ServerWebExchange` that was rejected
  `serverExchangeRejectedException` - that caused the invocation