Author: mtredinnick
Date: 2007-10-03 17:21:43 -0500 (Wed, 03 Oct 2007)
New Revision: 6449

Modified:
   django/trunk/django/http/__init__.py
Log:
Fixed #4986 -- Fixed a logic bug from [6166].


Modified: django/trunk/django/http/__init__.py
===================================================================
--- django/trunk/django/http/__init__.py        2007-10-03 22:12:22 UTC (rev 
6448)
+++ django/trunk/django/http/__init__.py        2007-10-03 22:21:43 UTC (rev 
6449)
@@ -47,8 +47,9 @@
     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.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to