summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 9a47e70592..baf9a11955 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -48,6 +48,8 @@ class HttpRequest(object):
"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 host:
+ return host
if 'HTTP_HOST' in self.META:
host = self.META['HTTP_HOST']
else: