public abstract class CorsUtils
extends java.lang.Object
Constructor and Description |
---|
CorsUtils() |
Modifier and Type | Method and Description |
---|---|
private static int |
getPort(java.lang.String scheme,
int port) |
static boolean |
isCorsRequest(HttpServletRequest request)
Returns
true if the request is a valid CORS one by checking Origin
header presence and ensuring that origins are different. |
static boolean |
isPreFlightRequest(HttpServletRequest request)
Returns
true if the request is a valid CORS pre-flight one. |
public static boolean isCorsRequest(HttpServletRequest request)
true
if the request is a valid CORS one by checking Origin
header presence and ensuring that origins are different.private static int getPort(@Nullable java.lang.String scheme, int port)
public static boolean isPreFlightRequest(HttpServletRequest request)
true
if the request is a valid CORS pre-flight one.
To be used in combination with isCorsRequest(HttpServletRequest)
since
regular CORS checks are not invoked here for performance reasons.