Less crazy config?

This commit is contained in:
Michael Tofias
2015-03-31 14:45:22 -05:00
parent 3e67792452
commit 7ba2684213
+8 -3
View File
@@ -11,9 +11,14 @@ class SSLify(object):
def __init__(self, app=None, age=YEAR_IN_SECS, subdomains=False, permanent=False, skips=None): def __init__(self, app=None, age=YEAR_IN_SECS, subdomains=False, permanent=False, skips=None):
self.app = app or current_app self.app = app or current_app
self.hsts_age = age self.hsts_age = age
self.hsts_include_subdomains = subdomains or self.app.config.get('SSL_SUBDOMAINS') or subdomains
self.permanent = permanent or self.app.config.get('SSL_PERMANENT') or permanent self.app.config.setdefault('SSL_SUBDOMAINS', False)
self.skip_list = skips or self.app.config.get('SSL_SKIPS') or skips self.app.config.setdefault('SSL_PERMANENT', False)
self.app.config.setdefault('SSL_SKIPS', None)
self.hsts_include_subdomains = subdomains or self.app.config['SSL_SUBDOMAINS']
self.permanent = permanent or self.app.config['SSL_PERMANENT']
self.skip_list = skips or self.app.config['SSL_SKIPS']
if app is not None: if app is not None:
self.init_app(app) self.init_app(app)