bug fix ('Host' header was being set to the conf.hostname for all getPages causing problems in some cases when retrieved page was not coming from that same Host)

This commit is contained in:
Miroslav Stampar 2011-05-13 01:01:53 +00:00
parent f11d5c91e3
commit a7d7be5ce0
3 changed files with 3 additions and 3 deletions

View File

@ -88,6 +88,7 @@ class HTTPHEADER:
CONTENT_RANGE = "Content-Range"
CONTENT_TYPE = "Content-Type"
COOKIE = "Cookie"
HOST = "Host"
PROXY_AUTHORIZATION = "Proxy-authorization"
RANGE = "Range"
REFERER = "Referer"

View File

@ -1027,9 +1027,6 @@ def __setHTTPMethod():
logger.debug(debugMsg)
def __setHTTPExtraHeaders():
if conf.hostname:
conf.httpHeaders.append(("Host", conf.hostname))
if conf.headers:
debugMsg = "setting extra HTTP headers"
logger.debug(debugMsg)

View File

@ -178,6 +178,8 @@ class Connect:
if kb.proxyAuthHeader:
headers[HTTPHEADER.PROXY_AUTHORIZATION] = kb.proxyAuthHeader
headers[HTTPHEADER.HOST] = urlparse.urlparse(url).netloc
if auxHeaders:
for key, item in auxHeaders.items():
headers[key] = item