Skip to content
Myr

Always percent-encode location headers.

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

authored by Cory Benfield · committed by Cory Benfield · parent eacb91a · Browse files · 1 file+3 added−1 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+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:requests/sessions.py+3 added-1 removed
109 unmodified lines
110 url = '%s:%s' % (parsed_rurl.scheme, url)111112 # Facilitate non-RFC2616-compliant 'location' headers113 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')114 # Compliant with RFC3986, we percent encode the url.115 if not urlparse(url).netloc:115 # Compliant with RFC3986, we percent encode the url.116 url = urljoin(resp.url, requote_uri(url))117 else:118 url = requote_uri(url)119120 prepared_request.url = url121122 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
391 unmodified lines