Send correct host header when using http proxy.

This commit is contained in:
Bastian Kleineidam 2010-07-29 06:50:35 +02:00
parent 9855b4c30e
commit 7536472797
2 changed files with 5 additions and 1 deletions

View file

@ -4,6 +4,9 @@ Fixes:
- ftp: Fix support for FTP ports other than the default.
- build: Use _WIN32 instead of WIN32 define to detect Windows systems.
Closes: SF bug #2978524
- http: Send correct host header when using proxies. Thanks Jason Martin
for the patch.
Closes: SF bug #3035754
Changes:
- checking: Caches are now size-restricted to limit the memory

View file

@ -487,7 +487,8 @@ Use URL `%(newurl)s' instead for checking.""") % {
self.urlparts[3], anchor))
self.url_connection.putrequest(self.method, path, skip_host=True,
skip_accept_encoding=True)
self.url_connection.putheader("Host", host)
# be sure to use the original host as header even for proxies
self.url_connection.putheader("Host", self.urlparts[1])
# userinfo is from http://user@pass:host/
if self.userinfo:
self.url_connection.putheader("Authorization", self.userinfo)