mirror of
https://github.com/not-kennethreitz/flask-sslify.git
synced 2026-06-05 06:56:15 +00:00
Less crazy config?
This commit is contained in:
+8
-3
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user