Skip to content

Commit

Permalink
#120 switch off filter for HTTP OPTIONS requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jnehring committed Jan 23, 2017
1 parent 545fecd commit ea0a0cd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,17 @@ public void init(FilterConfig filterConfig) throws ServletException {
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {

if (!(req instanceof HttpServletRequest) || !(res instanceof HttpServletResponse) || req.getParameter("filter")==null) {
if (!(req instanceof HttpServletRequest) || !(res instanceof HttpServletResponse) || req.getParameter("filter")==null ) {
chain.doFilter(req, res);
}else{
HttpServletRequest httpRequest = (HttpServletRequest) req;
HttpServletResponse httpResponse = (HttpServletResponse) res;

// skip postprocessing filter for OPTIONS requests
if(httpRequest.getMethod().toLowerCase().equals("options")){
chain.doFilter(req, res);
return;
}

String responseContent = null;
int responseStatus = HttpStatus.OK.value();
Expand Down

0 comments on commit ea0a0cd

Please sign in to comment.