Skip to content
Myr

Merge pull request #2168 from ContinuousFunction/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Tracking Previous Requests

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 53d3cec, 2fc6e8a · Browse files · 2 files+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−0 removed

  • other:+16 added−0 removed

2 files+16 added−0 removed

modified:requests/sessions.py+7 added
89 unmodified lines
90 verify=True, cert=None, proxies=None):91 """Receives a Response. Returns a generator of Responses."""9293 i = 094 hist = [] #keep track of history9596 while resp.is_redirect:97 prepared_request = req.copy()9899 if i > 0:100 #update history and keep track of redirects101 hist.append(resp)102 new_hist = list(hist)103 resp.history = new_hist104105 try:106 resp.content # Consume socket so it can be released107 except (ChunkedEncodingError, ContentDecodingError, RuntimeError):108 resp.raw.read(decode_content=False)
544 unmodified lines
modified:test_requests.py+9 added
972 unmodified lines
973 s = _basic_auth_str("test", "test")974 assert isinstance(s, builtin_str)975 assert s == "Basic dGVzdDp0ZXN0"976977 def test_requests_history_is_saved(self):978 r = requests.get('https://httpbin.org/redirect/5')979 total = r.history[-1].history980 i = 0981 for item in r.history:982 assert item.history == total[0:i]983 i=i+1984985986class TestContentEncodingDetection(unittest.TestCase):987988 def test_none(self):989 encodings = requests.utils.get_encodings_from_content('')
381 unmodified lines
1371 TestRedirects.default_keyword_args)1372 assert session.calls[-1] == send_call1373137413751376@pytest.fixture1377def list_of_tuples():1378 return [1379 (('a', 'b'), ('c', 'd')),
55 unmodified lines