Skip to content

Instantly share code, notes, and snippets.

@RealDeanZhao
Created March 31, 2017 08:45
Show Gist options
  • Save RealDeanZhao/fe35955a4998e8051d063afa872952ba to your computer and use it in GitHub Desktop.
Save RealDeanZhao/fe35955a4998e8051d063afa872952ba to your computer and use it in GitHub Desktop.
Ignore the specific url in a fitler
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest httpRequest = (HttpServletRequest) request;
final HttpServletResponse httpResponse = (HttpServletResponse) response;
final String path = ((HttpServletRequest) request).getRequestURI();
if (path.startsWith("/api/v1/oauth")) {
chain.doFilter(request, response);
} else {
chain.doFilter(request, response);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment