Commit f1871bbb authored by Guido van Rossum's avatar Guido van Rossum

Hack so that if a 302 or 301 redirect contains a relative URL, the

right thing "just happens" (basejoin() with old URL).
parent ea2bb67d
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment