Package org.springframework.web.cors
Interface CorsProcessor
- All Known Implementing Classes:
DefaultCorsProcessor
public interface CorsProcessor
A strategy that takes a request and aCorsConfiguration
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.- Since:
- 4.2
- Author:
- Sebastien Deleuze, Rossen Stoyanchev
- See Also:
- CORS W3C recommendation,
AbstractHandlerMapping.setCorsProcessor(org.springframework.web.cors.CorsProcessor)
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
processRequest(CorsConfiguration configuration, HttpServletRequest request, HttpServletResponse response)
Process a request given aCorsConfiguration
.
Method Detail
processRequest
boolean processRequest(CorsConfiguration configuration, HttpServletRequest request, HttpServletResponse response) throws IOException
Process a request given aCorsConfiguration
.- Parameters:
configuration
- the applicable CORS configuration (possiblynull
)request
- the current requestresponse
- the current response- Returns:
false
if the request is rejected,true
otherwise- Throws:
IOException