mirror of
https://github.com/not-kennethreitz/flask-sslify.git
synced 2026-06-05 15:00:21 +00:00
HSTS Policy
This commit is contained in:
+8
-1
@@ -25,4 +25,11 @@ class SSLify(object):
|
||||
|
||||
if not any(criteria):
|
||||
url = request.url.replace('http://', 'https://')
|
||||
return redirect(url)
|
||||
r = redirect(url)
|
||||
|
||||
# HSTS policy.
|
||||
r.headers['Strict-Transport-Security'] = 'max-age=31536000'
|
||||
|
||||
return r
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user