diff options
author | Matt Robenolt <matt@ydekproductions.com> | 2014-11-23 17:54:44 -0800 |
---|---|---|
committer | Matt Robenolt <matt@ydekproductions.com> | 2014-11-23 17:54:44 -0800 |
commit | 2a5364cf72fb8156773d6304c0e3e21472de8002 (patch) | |
tree | e01a8815f36e987faf1b35385bd33ae6e43df372 | |
parent | 9dc660269f3270cf60ba5e1fd855e853241218d5 (diff) | |
download | python-requests-2a5364cf72fb8156773d6304c0e3e21472de8002.tar.gz |
url was already parsed, don't urlparse twice
-rw-r--r-- | requests/sessions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/requests/sessions.py b/requests/sessions.py index c2f42b14..4eb374fd 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -129,7 +129,7 @@ class SessionRedirectMixin(object): # Facilitate relative 'location' headers, as allowed by RFC 7231. # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') # Compliant with RFC3986, we percent encode the url. - if not urlparse(url).netloc: + if not parsed.netloc: url = urljoin(resp.url, requote_uri(url)) else: url = requote_uri(url) |