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(ServerHttpRequest request)
Returns
true if the request is a valid CORS one. |
static boolean |
isPreFlightRequest(ServerHttpRequest request)
Returns
true if the request is a valid CORS pre-flight one. |
static boolean |
isSameOrigin(ServerHttpRequest request)
Check if the request is a same-origin one, based on
Origin , Host ,
Forwarded , X-Forwarded-Proto , X-Forwarded-Host and |
public static boolean isCorsRequest(ServerHttpRequest request)
true
if the request is a valid CORS one.public static boolean isPreFlightRequest(ServerHttpRequest request)
true
if the request is a valid CORS pre-flight one.public static boolean isSameOrigin(ServerHttpRequest request)
Origin
, Host
,
Forwarded
, X-Forwarded-Proto
, X-Forwarded-Host
andtrue
if the request is a same-origin one, false
in case
of cross-origin request.private static int getPort(@Nullable java.lang.String scheme, int port)