public abstract class CorsUtils extends Object
| Constructor and Description |
|---|
CorsUtils() |
| Modifier and Type | Method and Description |
|---|---|
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, and
Host headers. |
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, and
Host headers.
Note: as of 5.1 this method ignores
"Forwarded" and "X-Forwarded-*" headers that specify the
client-originated address. Consider using the ForwardedHeaderFilter
to extract and use, or to discard such headers.
true if the request is a same-origin one, false in case
of a cross-origin request