From d8d94340743cfb127cff65dabf9f735bb768f143 Mon Sep 17 00:00:00 2001 From: Michael Tofias Date: Tue, 31 Mar 2015 12:28:32 -0500 Subject: [PATCH] =?UTF-8?q?Fixed=20current=5Fapp=20stuff=20which=20I=20too?= =?UTF-8?q?k=20out=20b/c=20=E2=80=A6=20=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_sslify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flask_sslify.py b/flask_sslify.py index 438771b..8fa2846 100644 --- a/flask_sslify.py +++ b/flask_sslify.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from flask import request, redirect +from flask import request, redirect, current_app YEAR_IN_SECS = 31536000 @@ -10,6 +10,7 @@ class SSLify(object): def __init__(self, app, age=YEAR_IN_SECS, subdomains=False, permanent=False, skips=None): if app is not None: + self.init_app(app) self.app = app self.hsts_age = age self.hsts_include_subdomains = subdomains or app.config.get('SSL_SUBDOMAINS') @@ -48,7 +49,7 @@ class SSLify(object): # Should we redirect? criteria = [ request.is_secure, - self.app.debug, + current_app.debug, request.headers.get('X-Forwarded-Proto', 'http') == 'https' ]