diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-10-06 22:34:48 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-10-06 22:34:48 +0000 |
| commit | 6104f6bd856a36e41352d3b90e7a550ef276daab (patch) | |
| tree | 0fc58d8a9cc6e2b2f47bc55c91b4d09c75de286e /django/http | |
| parent | 4e3eb6ed5f9b7b74b47b33439dde7995e08d5933 (diff) | |
newforms-admin: Merged to [6458]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 5 |
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. |
