diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index 40c5fe9b9..a74327942 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -118,7 +118,11 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl) if headers and HTTP_HEADER.SET_COOKIE in headers: req.headers[HTTP_HEADER.COOKIE] = headers[HTTP_HEADER.SET_COOKIE].split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER)[0] - result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers) + try: + result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers) + except: + redurl = None + result = fp else: result = fp