CorsProcessor,
as defined by the CORS W3C recommendation.
Note that when the supplied CorsConfiguration is null, this
implementation does not reject simple or actual requests outright but simply
avoids adding CORS headers to the response. CORS processing is also skipped
if the response already contains CORS headers.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK
The |
| pack-priv static final String | ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK
The |
| private static final Log | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected List | checkHeaders(CorsConfiguration config, List<String> requestHeaders)
Check the headers and determine the headers for the response of a pre-flight request. |
| protected List | checkMethods(CorsConfiguration config, HttpMethod requestMethod)
Check the HTTP method and determine the methods for the response of a pre-flight request. |
| protected String | checkOrigin(CorsConfiguration config, String requestOrigin)
Check the origin and determine the origin for the response. |
| private List | |
| private HttpMethod | |
| protected boolean | handleInternal(ServerWebExchange exchange, CorsConfiguration config, boolean preFlightRequest)
Handle the given request. |
| public boolean | process(CorsConfiguration
the CORS configuration to use; possibly config, ServerWebExchange null
in which case pre-flight requests are rejected, but all others allowed.the current exchange exchange)Implements org. Process a request using the given |
| protected void |
| ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK | back to summary |
|---|---|
| pack-priv static final String ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK The
| |
| ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK | back to summary |
|---|---|
| pack-priv static final String ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK The
| |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| VARY_HEADERS | back to summary |
|---|---|
| private static final List<String> VARY_HEADERS | |
| DefaultCorsProcessor | back to summary |
|---|---|
| public DefaultCorsProcessor() | |
| checkHeaders | back to summary |
|---|---|
| protected List Check the headers and determine the headers for the response of a
pre-flight request. The default implementation simply delegates to
| |
| checkMethods | back to summary |
|---|---|
| protected List Check the HTTP method and determine the methods for the response of a
pre-flight request. The default implementation simply delegates to
| |
| checkOrigin | back to summary |
|---|---|
| protected String checkOrigin(CorsConfiguration config, String requestOrigin) Check the origin and determine the origin for the response. The default
implementation simply delegates to
| |
| getHeadersToUse | back to summary |
|---|---|
| private List | |
| getMethodToUse | back to summary |
|---|---|
private HttpMethod getMethodToUse(ServerHttpRequest request, boolean isPreFlight)
| |
| handleInternal | back to summary |
|---|---|
| protected boolean handleInternal(ServerWebExchange exchange, CorsConfiguration config, boolean preFlightRequest) Handle the given request. | |
| process | back to summary |
|---|---|
| public boolean process(CorsConfiguration config, ServerWebExchange exchange) Implements org. Doc from org. Process a request using the given
| |
| rejectRequest | back to summary |
|---|---|
| protected void rejectRequest(ServerHttpResponse response) Invoked when one of the CORS checks failed. | |