Skip to content
Myr

resolve_redirects no longer throws an InvalidSchema exception when the scheme is uppercase

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Bob Carroll · committed by Bob Carroll · parent 3bb13f8 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:requests/sessions.py+4 added
95 unmodified lines
96 if url.startswith('//'):97 parsed_rurl = urlparse(resp.url)98 url = '%s:%s' % (parsed_rurl.scheme, url)99100 # The scheme should be lower case...101 scheme, uri = url.split('://')102 url = '%s://%s' % (scheme.lower(), uri)103104 # Facilitate non-RFC2616-compliant 'location' headers105 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')106 # Compliant with RFC3986, we percent encode the url.107 if not urlparse(url).netloc:
398 unmodified lines