mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
resolve_redirects no longer throws an InvalidSchema exception when the scheme is uppercase
This commit is contained in:
@@ -97,6 +97,10 @@ class SessionRedirectMixin(object):
|
||||
parsed_rurl = urlparse(resp.url)
|
||||
url = '%s:%s' % (parsed_rurl.scheme, url)
|
||||
|
||||
# The scheme should be lower case...
|
||||
scheme, uri = url.split('://')
|
||||
url = '%s://%s' % (scheme.lower(), uri)
|
||||
|
||||
# Facilitate non-RFC2616-compliant 'location' headers
|
||||
# (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')
|
||||
# Compliant with RFC3986, we percent encode the url.
|
||||
|
||||
Reference in New Issue
Block a user