mitreid-connect
公開メンバ関数 | 全メンバ一覧
org.mitre.oauth2.web.CorsFilter クラス
org.mitre.oauth2.web.CorsFilter の継承関係図
Inheritance graph
org.mitre.oauth2.web.CorsFilter 連携図
Collaboration graph

公開メンバ関数

void doFilterInternal (HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException
 

詳解

Implements Cross-Origin Resource Sharing (CORS) headers. This filter adds the CORS headers to all requests that pass through it, and as such it should be used only on endpoints that require CORS support.

著者
jricher

関数詳解

◆ doFilterInternal()

void org.mitre.oauth2.web.CorsFilter.doFilterInternal ( HttpServletRequest  request,
HttpServletResponse  response,
FilterChain  filterChain 
) throws IOException, ServletException
inline
49  {
50 
51  response.addHeader("Access-Control-Allow-Origin", "*");
52  if (request.getHeader("Access-Control-Request-Method") != null && "OPTIONS".equals(request.getMethod())) {
53  // CORS "pre-flight" request
54  response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
55  response.addHeader("Access-Control-Allow-Headers", "X-Requested-With,Origin,Content-Type, Accept, Authorization");
56  }
57  filterChain.doFilter(request, response);
58  }

このクラス詳解は次のファイルから抽出されました: