diff options
author | Kenneth Reitz <me@kennethreitz.org> | 2014-11-30 14:11:52 -0500 |
---|---|---|
committer | Kenneth Reitz <me@kennethreitz.org> | 2014-11-30 14:11:52 -0500 |
commit | 1c4a666b161772d64af91d744e9ac9e92602ff3c (patch) | |
tree | e01a8815f36e987faf1b35385bd33ae6e43df372 | |
parent | 9dc660269f3270cf60ba5e1fd855e853241218d5 (diff) | |
parent | 2a5364cf72fb8156773d6304c0e3e21472de8002 (diff) | |
download | python-requests-1c4a666b161772d64af91d744e9ac9e92602ff3c.tar.gz |
Merge pull request #2353 from mattrobenolt/patch-1
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) |