mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Hack so that if a 302 or 301 redirect contains a relative URL, the
right thing "just happens" (basejoin() with old URL).
This commit is contained in:
parent
c91fcaa43b
commit
3527f59457
1 changed files with 2 additions and 0 deletions
|
@ -451,6 +451,8 @@ class FancyURLopener(URLopener):
|
|||
return
|
||||
void = fp.read()
|
||||
fp.close()
|
||||
# In case the server sent a relative URL, join with original:
|
||||
newurl = basejoin("http:" + url, newurl)
|
||||
return self.open(newurl, data)
|
||||
|
||||
# Error 301 -- also relocated (permanently)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue