Ticket #6880: get_hostpatch.txt

File get_hostpatch.txt, 711 bytes (added by Kellen, 15 years ago)

removes usage of X_HTTP_FORWARDED HOST

Line 
1Index: django/http/__init__.py
2===================================================================
3--- django/http/__init__.py (revision 11040)
4+++ django/http/__init__.py (working copy)
5@@ -45,9 +45,7 @@
6 def get_host(self):
7 """Returns the HTTP host using the environment or request headers."""
8 # We try three options, in order of decreasing preference.
9- if 'HTTP_X_FORWARDED_HOST' in self.META:
10- host = self.META['HTTP_X_FORWARDED_HOST']
11- elif 'HTTP_HOST' in self.META:
12+ if 'HTTP_HOST' in self.META:
13 host = self.META['HTTP_HOST']
14 else:
15 # Reconstruct the host using the algorithm from PEP 333.
Back to Top