mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
history is a tuple, not list
This commit is contained in:
@@ -253,24 +253,23 @@ class Session(SessionMixin):
|
||||
|
||||
resp = self.send(prep)
|
||||
|
||||
# Redirect generator.
|
||||
# Redirect resolving generator.
|
||||
gen = self.resolve_redirects(resp, req, prefetch, timeout, verify, cert)
|
||||
|
||||
# Resolve redirects if allowed.
|
||||
history = [r for r in gen] if allow_redirects else []
|
||||
|
||||
# Shuffle things around if there's history.
|
||||
if history:
|
||||
history.insert(0, resp)
|
||||
resp = history.pop()
|
||||
resp.history = history
|
||||
resp.history = tuple(history)
|
||||
|
||||
return resp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get(self, url, **kwargs):
|
||||
"""Sends a GET request. Returns :class:`Response` object.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user