Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created August 14, 2017 16:03
Show Gist options
  • Save mitsuhiko/82b441571de51f8d180bd2e4cfd9d0e5 to your computer and use it in GitHub Desktop.
Save mitsuhiko/82b441571de51f8d180bd2e4cfd9d0e5 to your computer and use it in GitHub Desktop.
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