mirror of
https://github.com/kennethreitz/flask-sslify.git
synced 2026-06-05 23:00:19 +00:00
Move hsts_age and other variables set in __init__ out of the if statement
This commit is contained in:
+4
-6
@@ -9,14 +9,12 @@ class SSLify(object):
|
||||
"""Secures your Flask App."""
|
||||
|
||||
def __init__(self, app=None, age=YEAR_IN_SECS, subdomains=False, permanent=False):
|
||||
if app is not None:
|
||||
self.hsts_age = age
|
||||
self.hsts_include_subdomains = subdomains
|
||||
self.permanent = permanent
|
||||
self.hsts_age = age
|
||||
self.hsts_include_subdomains = subdomains
|
||||
self.permanent = permanent
|
||||
|
||||
if app is not None:
|
||||
self.init_app(self.app)
|
||||
else:
|
||||
self.app = None
|
||||
|
||||
def init_app(self, app):
|
||||
"""Configures the configured Flask app to enforce SSL."""
|
||||
|
||||
Reference in New Issue
Block a user