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
ConstructorDescriptionConstructs an instance which uses400
as response code.HttpStatusExchangeRejectedHandler
(org.springframework.http.HttpStatus status) Constructs an instance which uses a configurable http code as response. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>
handle
(org.springframework.web.server.ServerWebExchange exchange, ServerExchangeRejectedException serverExchangeRejectedException) Handles an request rejected failure.
-
Constructor Details
-
HttpStatusExchangeRejectedHandler
public HttpStatusExchangeRejectedHandler()Constructs an instance which uses400
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 interfaceServerExchangeRejectedHandler
- Parameters:
exchange
- theServerWebExchange
that was rejectedserverExchangeRejectedException
- that caused the invocation
-