Update Site.find_for_request to respect https

This commit is contained in:
Nick Smith 2014-06-27 11:18:11 +01:00
parent ee9297b445
commit 781aabad97

View file

@ -53,7 +53,7 @@ class Site(models.Model):
hostname, port = request.META['HTTP_HOST'].split(':')
except ValueError:
hostname = request.META['HTTP_HOST']
port = '80' # FIXME do we want this default?
port = '443' if request.is_secure() else '80'
except KeyError:
# explicit routing straight to the final except clause
raise