Skip to content

Instantly share code, notes, and snippets.

@jgeraerts
Created October 26, 2011 13:25
Show Gist options
  • Save jgeraerts/1316339 to your computer and use it in GitHub Desktop.
Save jgeraerts/1316339 to your computer and use it in GitHub Desktop.
public class SSLFIlter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
filterChain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) servletRequest){
@Override
public boolean isSecure() {
return ((HttpServletRequest) servletRequest).getHeader("X-SSL-WHATEVER") != null);
}
},servletResponse);
}
@Override
public void destroy() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment