Top Description Methods
org.springframework.web.cors

public Interface CorsProcessor

Known Direct Implementers
org.springframework.web.cors.DefaultCorsProcessor
Imports
java.io.IOException, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, org.springframework.lang.Nullable

A strategy that takes a request and a CorsConfiguration and updates the response.

This component is not concerned with how a CorsConfiguration is selected but rather takes follow-up actions such as applying CORS validation checks and either rejecting the response or adding CORS headers to the response.

Authors
Sebastien Deleuze, Rossen Stoyanchev
Since
4.2
See Also
CORS W3C recommendation, org.springframework.web.servlet.handler.AbstractHandlerMapping#setCorsProcessor

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

false if the request is rejected, true otherwise
processRequest
(CorsConfiguration
the applicable CORS configuration (possibly null)
configuration
,
HttpServletRequest
the current request
request
,
HttpServletResponse
the current response
response
)

Process a request given a CorsConfiguration.

Method Detail

processRequestback to summary
public boolean processRequest(CorsConfiguration configuration, HttpServletRequest request, HttpServletResponse response) throws IOException

Process a request given a CorsConfiguration.

Parameters
configuration:CorsConfiguration

the applicable CORS configuration (possibly null)

request:HttpServletRequest

the current request

response:HttpServletResponse

the current response

Returns:boolean

false if the request is rejected, true otherwise