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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCorsRequest(HttpServletRequest request) Returnstrueif the request is a valid CORS one by checkingOriginheader presence and ensuring that origins are different.static booleanisPreFlightRequest(HttpServletRequest request) Returnstrueif the request is a valid CORS pre-flight one by checking {code OPTIONS} method 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. -
isPreFlightRequest
Returnstrueif the request is a valid CORS pre-flight one by checking {code OPTIONS} method withOriginandAccess-Control-Request-Methodheaders presence.
-