From 7e190f18bbb8a10e93e5f84f738f04e8271ff659 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Tue, 8 Jul 2008 19:43:19 +0000 Subject: set correct Host header without port number in it git-svn-id: http://arthurdejong.org/svn/webcheck/webcheck@385 86f53f14-5ff3-0310-afe5-9b438ce3f40c --- schemes/http.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/schemes/http.py b/schemes/http.py index 219eb9b..0a5c73c 100644 --- a/schemes/http.py +++ b/schemes/http.py @@ -80,8 +80,10 @@ def fetch(link, acceptedtypes): conn = httplib.HTTPConnection(netloc) elif scheme == 'https': conn = httplib.HTTPSConnection(netloc) - # the requests adds a correct host header for us - conn.putrequest('GET', path) + conn.set_debuglevel(100) + # start the request + conn.putrequest('GET', path, skip_host=True) + conn.putheader('Host', urllib.splitport(netloc)[0]) if userpass is not None: (user, passwd) = urllib.splitpasswd(userpass) conn.putheader( -- cgit v1.2.3