mirror of
https://github.com/kennethreitz/flask-sslify.git
synced 2026-06-05 23:00:19 +00:00
Merge pull request #4 from nvie/master
Replace only the scheme part of the URL.
This commit is contained in:
+4
-3
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user