Patch for an Issue #667

This commit is contained in:
Miroslav Stampar 2014-04-07 21:01:40 +02:00
parent cb0044b2c4
commit 2d3a74a0fe

View File

@ -104,11 +104,15 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, redirectMsg)
if redurl:
if not urlparse.urlsplit(redurl).netloc:
redurl = urlparse.urljoin(req.get_full_url(), redurl)
try:
if not urlparse.urlsplit(redurl).netloc:
redurl = urlparse.urljoin(req.get_full_url(), redurl)
self._infinite_loop_check(req)
self._ask_redirect_choice(code, redurl, req.get_method())
self._infinite_loop_check(req)
self._ask_redirect_choice(code, redurl, req.get_method())
except ValueError:
redurl = None
result = fp
if redurl and kb.redirectChoice == REDIRECTION.YES:
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)