From 5d87d4729596b0c385e3fa50581ee100396cae2d Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Mon, 9 Apr 2001 14:54:21 +0000 Subject: [PATCH] fixing 408085 - redirect from https becomes http Even though relative redirects are illegal, they are common urllib treated every relative redirect as though it was to http, even if the original was https:// As long as we're compensating for server bugs, might as well do it properly. --- Lib/urllib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index 5572580701..3175199a96 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -556,7 +556,7 @@ class FancyURLopener(URLopener): void = fp.read() fp.close() # In case the server sent a relative URL, join with original: - newurl = basejoin("http:" + url, newurl) + newurl = basejoin(self.type + ":" + url, newurl) if data is None: return self.open(newurl) else: -- 2.50.0