Package org.springframework.web.cors
Class CorsUtils
java.lang.Object
org.springframework.web.cors.CorsUtils
Utility class for CORS request handling based on the
CORS W3C recommendation.
- Since:
- 4.2
- Author:
- Sebastien Deleuze
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isCorsRequest
(HttpServletRequest request) Returnstrue
if the request is a valid CORS one by checkingOrigin
header presence and ensuring that origins are different.static boolean
isPreFlightRequest
(HttpServletRequest request) Returnstrue
if the request is a valid CORS pre-flight one by checkingOPTIONS
method withOrigin
andAccess-Control-Request-Method
headers presence.
-
Constructor Details
-
CorsUtils
public CorsUtils()
-
-
Method Details
-
isCorsRequest
Returnstrue
if the request is a valid CORS one by checkingOrigin
header presence and ensuring that origins are different. -
isPreFlightRequest
Returnstrue
if the request is a valid CORS pre-flight one by checkingOPTIONS
method withOrigin
andAccess-Control-Request-Method
headers presence.
-