Class Cors
java.lang.Object
com.soklet.core.Cors
Encapsulates non-preflight CORS HTTP request data.
Data for preflight requests is represented by CorsPreflight
.
See https://www.soklet.com/docs/cors for detailed documentation.
- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionCors
(HttpMethod httpMethod, String origin) Constructs a CORS non-preflight request representation for the given HTTP request data. -
Method Summary
Modifier and TypeMethodDescriptionboolean
fromHeaders
(HttpMethod httpMethod, Map<String, Set<String>> headers) Extracts a CORS non-preflight request representation from the given HTTP request data.The HTTP method for this request.The HTTPOrigin
header value for this request.int
hashCode()
toString()
-
Constructor Details
-
Cors
-
-
Method Details
-
fromHeaders
@Nonnull public static Optional<Cors> fromHeaders(@Nonnull HttpMethod httpMethod, @Nonnull Map<String, Set<String>> headers) Extracts a CORS non-preflight request representation from the given HTTP request data.- Parameters:
httpMethod
- the request's HTTP methodheaders
- the request headers- Returns:
- the CORS non-preflight data for this request, or
Optional.empty()
if insufficent data is present
-
toString
-
equals
-
hashCode
-
getHttpMethod
The HTTP method for this request.- Returns:
- the HTTP method
-
getOrigin
-