fix for redirect/HOST header bug

This commit is contained in:
Miroslav Stampar
2011-11-11 11:28:27 +00:00
parent 1061c06617
commit ccbd93cc2e
4 changed files with 32 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ from lib.core.common import cpuThrottle
from lib.core.common import extractRegexResult
from lib.core.common import getCurrentThreadData
from lib.core.common import getFilteredPageContent
from lib.core.common import getHostHeader
from lib.core.common import getUnicode
from lib.core.common import logHTTPTraffic
from lib.core.common import parseTargetUrl
@@ -234,10 +235,7 @@ class Connect:
headers[HTTPHEADER.ACCEPT] = HTTP_ACCEPT_HEADER_VALUE
headers[HTTPHEADER.HOST] = urlparse.urlparse(url).netloc
if any(map(lambda x: headers[HTTPHEADER.HOST].endswith(':%d' % x), [80, 443])):
headers[HTTPHEADER.HOST] = headers[HTTPHEADER.HOST].split(':')[0]
headers[HTTPHEADER.HOST] = getHostHeader(url)
if auxHeaders:
for key, item in auxHeaders.items():