mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
f870c952f9
commit
5d87d47295
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue