From c50560c3a64e3b7678869d3ac212dc192426121a Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 10 Jun 2014 21:57:54 +0200 Subject: [PATCH] Patch for an Issue #716 --- lib/request/redirecthandler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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