Class PreFlightRequestWebFilter

java.lang.Object
org.springframework.web.cors.reactive.PreFlightRequestWebFilter
All Implemented Interfaces:
WebFilter

public class PreFlightRequestWebFilter extends Object implements WebFilter
WebFilter that handles pre-flight requests through a PreFlightRequestHandler and bypasses the rest of the chain.

A WebFlux application can simply inject PreFlightRequestHandler and use it to create an instance of this WebFilter since @EnableWebFlux declares DispatcherHandler as a bean and that is a PreFlightRequestHandler.

Since:
5.3.7
Author:
Rossen Stoyanchev
  • Constructor Details

    • PreFlightRequestWebFilter

      public PreFlightRequestWebFilter(PreFlightRequestHandler handler)
      Create an instance that will delegate to the given handler.
  • Method Details

    • filter

      public reactor.core.publisher.Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain)
      Description copied from interface: WebFilter
      Process the Web request and (optionally) delegate to the next WebFilter through the given WebFilterChain.
      Specified by:
      filter in interface WebFilter
      Parameters:
      exchange - the current server exchange
      chain - provides a way to delegate to the next filter
      Returns:
      Mono<Void> to indicate when request processing is complete