From 53e7bfa2d1ac6aa9a6777fcfb8ba7c9ae388ef8e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 29 Apr 2012 16:54:45 -0400 Subject: [PATCH] change app reference --- flask_sslify.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flask_sslify.py b/flask_sslify.py index c7a228c..6baa596 100644 --- a/flask_sslify.py +++ b/flask_sslify.py @@ -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' ]