Skip to content

Instantly share code, notes, and snippets.

View elmot's full-sized avatar

Ilia Motornyi elmot

View GitHub Profile
@elmot
elmot / HttpsFilter.java
Created January 24, 2017 23:03
Heroku - filter to redirect http requests to https
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class HttpsFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;