HSTS Policy

This commit is contained in:
Kenneth Reitz
2012-04-29 17:34:01 -04:00
parent 53e7bfa2d1
commit e9191b8aad
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -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
+1 -1
View File
@@ -12,7 +12,7 @@ from setuptools import setup
setup(
name='Flask-SSLify',
version='0.1.1',
version='0.1.2',
url='https://github.com/kennethreitz/flask-sslify',
license='BSD',
author='Kenneth Reitz',