Class CorsUtils
java.lang.Object
org.springframework.web.cors.reactive.CorsUtils
Utility class for CORS reactive request handling based on the
CORS W3C recommendation.
- Since:
- 5.0
- Author:
- Sebastien Deleuze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCorsRequest(ServerHttpRequest request) Returnstrueif the request is a valid CORS one by checkingOriginheader presence and ensuring that origins are different viaisSameOrigin(ServerHttpRequest).static booleanisPreFlightRequest(ServerHttpRequest request) Returnstrueif the request is a valid CORS pre-flight one by checkingOPTIONSmethod withOriginandAccess-Control-Request-Methodheaders presence.
-
Constructor Details
-
CorsUtils
public CorsUtils()
-
-
Method Details
-
isCorsRequest
Returnstrueif the request is a valid CORS one by checkingOriginheader presence and ensuring that origins are different viaisSameOrigin(ServerHttpRequest). -
isPreFlightRequest
Returnstrueif the request is a valid CORS pre-flight one by checkingOPTIONSmethod withOriginandAccess-Control-Request-Methodheaders presence.
-