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 |
| 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(ServerHttpRequest request, ServerHttpResponse response, CorsConfiguration config, boolean preFlightRequest)
Handle the given request. |
| public boolean | processRequest(CorsConfiguration
the applicable CORS configuration (possibly config, HttpServletRequest null)the current request request, HttpServletResponse the current response response)Implements org. Process a request given a |
| 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 | |
| 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(ServerHttpRequest request, ServerHttpResponse response, CorsConfiguration config, boolean preFlightRequest) throws IOException Handle the given request. | |
| processRequest | back to summary |
|---|---|
| public boolean processRequest(CorsConfiguration config, HttpServletRequest request, HttpServletResponse response) throws IOException Implements org. Doc from org. Process a request given a
| |
| rejectRequest | back to summary |
|---|---|
| protected void rejectRequest(ServerHttpResponse response) throws IOException Invoked when one of the CORS checks failed. The default implementation sets the response status to 403 and writes "Invalid CORS request" to the response. | |