Class CorsUtils

java.lang.Object
org.springframework.web.cors.reactive.CorsUtils

public abstract class CorsUtils extends Object
Utility class for CORS reactive request handling based on the CORS W3C recommendation.
Since:
5.0
Author:
Sebastien Deleuze
  • Constructor Details

    • CorsUtils

      public CorsUtils()
  • Method Details

    • isCorsRequest

      public static boolean isCorsRequest(ServerHttpRequest request)
      Returns true if the request is a valid CORS one by checking Origin header presence and ensuring that origins are different via isSameOrigin(ServerHttpRequest).
    • isPreFlightRequest

      public static boolean isPreFlightRequest(ServerHttpRequest request)
      Returns true if the request is a valid CORS pre-flight one by checking OPTIONS method with Origin and Access-Control-Request-Method headers presence.