From 4d576928a7a0780c7853603be244369637ae01ec Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 22 Nov 2015 16:05:48 +0100 Subject: [PATCH] Fixes #1554 --- lib/request/connect.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 6139eac15..40e873fe3 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -476,7 +476,7 @@ class Connect(object): status = getUnicode(conn.msg) if extractRegexResult(META_REFRESH_REGEX, page) and not refreshing: - url = extractRegexResult(META_REFRESH_REGEX, page) + refresh = extractRegexResult(META_REFRESH_REGEX, page) debugMsg = "got HTML meta refresh header" logger.debug(debugMsg) @@ -491,13 +491,14 @@ class Connect(object): kb.alwaysRefresh = choice not in ("n", "N") if kb.alwaysRefresh: - if url.lower().startswith('http://'): - kwargs['url'] = url + if re.search(r"\Ahttps?://", refresh, re.I): + url = refresh else: - kwargs['url'] = conf.url[:conf.url.rfind('/') + 1] + url + url = urlparse.urljoin(url, refresh) threadData.lastRedirectMsg = (threadData.lastRequestUID, page) kwargs['refreshing'] = True + kwargs['url'] = url kwargs['get'] = None kwargs['post'] = None