newurl = headers.getheaders('uri')[0]
else:
return
+
+ # fix a possible malformed URL
+ urlparts = urlparse.urlparse(newurl)
+ if not urlparts.path:
+ urlparts = list(urlparts)
+ urlparts[2] = "/"
+ newurl = urlparse.urlunparse(urlparts)
+
newurl = urlparse.urljoin(req.get_full_url(), newurl)
# XXX Probably want to forget about the state of the current
Library
-------
+- Issue 2464. urllib2 now supports a malformation in the URL received
+ in a redirect.
+
- Silence the DeprecationWarning raised when importing mimetools in
BaseHTTPServer, cgi (and rfc822), httplib.