Package org.apache.shiro.web.util
Interface CorsUtils
public interface CorsUtils
Utility class for CORS request handling based on the W3.
- Since:
- 2.0.7
- See Also:
-
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic booleanisPreFlightRequest(javax.servlet.http.HttpServletRequest request) Determines whether the givenHttpServletRequestrepresents a CORS preflight request.
-
Field Details
-
ORIGIN
The HTTPOriginheader field name.- See Also:
-
ACCESS_CONTROL_REQUEST_METHOD
The CORSAccess-Control-Request-Methodrequest header field name.- See Also:
-
OPTIONS
- See Also:
-
-
Method Details
-
isPreFlightRequest
Determines whether the givenHttpServletRequestrepresents a CORS preflight request.A CORS preflight request is an
OPTIONSrequest sent by browsers before the actual cross-origin request, to verify that the target server allows the actual request's method and headers.This method returns
trueif and only if:- The HTTP method is
OPTIONS, - The
Originheader is present, and - The
Access-Control-Request-Methodheader is present.
- Parameters:
request- the incoming HTTP request to inspect (must not benull)- Returns:
trueif the request is a valid CORS preflight request;falseotherwise
- The HTTP method is
-