--- trunk/django/http/__init__.py.org	2008-09-12 22:53:11.000000000 +0300
+++ trunk/django/http/__init__.py	2008-09-12 22:53:08.000000000 +0300
@@ -47,6 +47,9 @@
         # We try three options, in order of decreasing preference.
         if 'HTTP_X_FORWARDED_HOST' in self.META:
             host = self.META['HTTP_X_FORWARDED_HOST']
+            comma = host.find(',')
+            if comma > -1:
+                host = host[0:comma]
         elif 'HTTP_HOST' in self.META:
             host = self.META['HTTP_HOST']
         else:
