mirror of
https://github.com/kennethreitz/flask-sslify.git
synced 2026-06-05 23:00:19 +00:00
change app reference
This commit is contained in:
+2
-4
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from flask import current_app as app
|
||||
from flask import request, redirect
|
||||
|
||||
class SSLify(object):
|
||||
@@ -16,12 +15,11 @@ class SSLify(object):
|
||||
def init_app(self, app):
|
||||
app.before_request(self.redirect)
|
||||
|
||||
@staticmethod
|
||||
def redirect():
|
||||
def redirect(self):
|
||||
|
||||
criteria = [
|
||||
request.is_secure,
|
||||
app.debug,
|
||||
self.app.debug,
|
||||
request.headers.get('X-Forwarded-Proto', 'http') == 'https'
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user