接口 CorsProcessor
- 所有已知实现类:
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.- 从以下版本开始:
- 4.2
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
- 另请参阅:
- CORS W3C recommendation,
AbstractHandlerMapping.setCorsProcessor(org.springframework.web.cors.CorsProcessor)
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 boolean
processRequest(CorsConfiguration configuration, HttpServletRequest request, HttpServletResponse response)
Process a request given aCorsConfiguration
.
方法详细资料
processRequest
boolean processRequest(CorsConfiguration configuration, HttpServletRequest request, HttpServletResponse response) throws IOException
Process a request given aCorsConfiguration
.- 参数:
configuration
- the applicable CORS configuration (possiblynull
)request
- the current requestresponse
- the current response- 返回:
false
if the request is rejected,true
otherwise- 抛出:
IOException