not-kennethreitz / flask-sslify

Force SSL on your Flask app.
https://pypi.python.org/pypi/Flask-SSLify
BSD 2-Clause "Simplified" License
504 stars 85 forks source link

Not functional #51

Open willgdjones opened 7 years ago

willgdjones commented 7 years ago

Following instructions doesn't seem to redirect my traffic.

def app_factory():
    app = Flask(__name__)

    app.config.from_object('config')

    if app.config['ENV'] == 'prod': # only trigger SSLify if the app is running on Heroku
        sslify = SSLify(app)

After I push everything up:

(venv)➜  heterogeneous git:(master) curl -I http://www.heterogeneous.co.uk
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.6.0
Date: Sun, 06 Aug 2017 21:12:39 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 45089
Via: 1.1 vegur

Potential reasons:

willgdjones commented 7 years ago

When navigating to my site for the first time via HTTP, my server returns an HTTP response.

After I navigate to the site once via HTTPS, all future HTTP future is routed via HTTPS. Is this unexpected or expected behaviour? Thanks in advance.