projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
359659c
)
Fix #2207
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Sun, 7 Sep 2014 17:02:23 +0000
(12:02 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Sun, 7 Sep 2014 17:02:23 +0000
(12:02 -0500)
@Lukasa wrote the fix in #2207
requests/sessions.py
patch
|
blob
|
history
diff --git
a/requests/sessions.py
b/requests/sessions.py
index 334db58eb14db9a19a4c435676aa9a1687781578..023edfbd3195066bddf8dc16b026cefb352e7616 100644
(file)
--- a/
requests/sessions.py
+++ b/
requests/sessions.py
@@
-134,8
+134,8
@@
class SessionRedirectMixin(object):
url = requote_uri(url)
prepared_request.url = to_native_string(url)
- #
cache the url
- if resp.is_permanent_redirect:
+ #
Cache the url, unless it redirects to itself.
+ if resp.is_permanent_redirect
and req.url != prepared_request.url
:
self.redirect_cache[req.url] = prepared_request.url
# http://tools.ietf.org/html/rfc7231#section-6.4.4