summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2007-10-16 16:54:23 +0000
committerJustin Bronn <jbronn@gmail.com>2007-10-16 16:54:23 +0000
commit58fc7897653b0a64658b3ece5d0ff429b4636130 (patch)
tree95ed4b510620ad3740b16cdff1395b4f10dbaee4 /django/http
parentba9fa9844c7996bf1362b9769c2c2fecf760a039 (diff)
Merged revisions 6442-6524 via svnmerge from [repos:django/trunk trunk].
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6525 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 9a47e70592..508c6d2f3e 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -47,8 +47,9 @@ class HttpRequest(object):
def get_host(self):
"Returns the HTTP host using the environment or request headers."
# We try three options, in order of decreasing preference.
- host = self.META.get('HTTP_X_FORWARDED_HOST', '')
- if 'HTTP_HOST' in self.META:
+ if 'HTTP_X_FORWARDED_HOST' in self.META:
+ host = self.META['HTTP_X_FORWARDED_HOST']
+ elif 'HTTP_HOST' in self.META:
host = self.META['HTTP_HOST']
else:
# Reconstruct the host using the algorithm from PEP 333.