Merge pull request #4 from nvie/master

Replace only the scheme part of the URL.
This commit is contained in:
Kenneth Reitz
2012-04-29 23:08:01 -07:00
+4 -3
View File
@@ -43,10 +43,11 @@ class SSLify(object):
]
if not any(criteria):
url = request.url.replace('http://', 'https://')
r = redirect(url)
if request.url.startswith('http://'):
url = request.url.replace('http://', 'https://', 1)
r = redirect(url)
return r
return r
def set_hsts_header(self, response):
"""Adds HSTS header to each response."""