Created
August 14, 2017 16:03
-
-
Save mitsuhiko/82b441571de51f8d180bd2e4cfd9d0e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fix_ssl(app): | |
def middleware(environ, start_response): | |
environ['wsgi.url_scheme'] = 'https' | |
return app(environ, start_response) | |
return middleware | |
app.wsgi_app = fix_ssl(app.wsgi_app) | |
app.config['PREFERRED_URL_SCHEME'] = 'https' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment