Skip to content

Commit

Permalink
Fix #2207
Browse files Browse the repository at this point in the history
@Lukasa wrote the fix in #2207
  • Loading branch information
sigmavirus24 committed Sep 7, 2014
1 parent 359659c commit 27c83f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions requests/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def resolve_redirects(self, resp, req, stream=False, timeout=None,
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
Expand Down

0 comments on commit 27c83f7

Please sign in to comment.