Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4986 -- Fixed a logic bug from [6166].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4d8b51f60c78b79186b53b9c55aa7169062603b9 1 parent 2a63414
@malcolmt malcolmt authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/http/__init__.py
View
5 django/http/__init__.py
@@ -47,8 +47,9 @@ def has_key(self, key):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.