Skip to content
Myr

Test case for requests getting stuck on post redirect with seekable stream

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

authored by tzickel · committed by Nate Prewitt · parent 9849c27 · Browse files · 2 files+17 added−1 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+17 added−1 removed

  • tests:+16 added−0 removed
  • other:+1 added−1 removed

2 files+17 added−1 removed

modified:tests/test_requests.py+16 added
163 unmodified lines
164 assert r.status_code == 200165 assert r.history[0].status_code == 302166 assert r.history[0].is_redirect167168 def test_HTTP_307_ALLOW_REDIRECT_POST(self, httpbin):169 parts = urlparse(httpbin('post'))170 url = "HTTP://" + parts.netloc + parts.path171 r = requests.post(httpbin('redirect-to'), data='test', params={'url': url, 'status_code': 307})172 assert r.status_code == 200173 assert r.history[0].status_code == 307174 assert r.history[0].is_redirect175176 def test_HTTP_307_ALLOW_REDIRECT_POST_WITH_SEEKABLE(self, httpbin):177 parts = urlparse(httpbin('post'))178 url = "HTTP://" + parts.netloc + parts.path179 r = requests.post(httpbin('redirect-to'), data=io.BytesIO(b'test'), params={'url': url, 'status_code': 307})180 assert r.status_code == 200181 assert r.history[0].status_code == 307182 assert r.history[0].is_redirect183184 def test_HTTP_302_TOO_MANY_REDIRECTS(self, httpbin):185 try:186 requests.get(httpbin('relative-redirect', '50'))187 except TooManyRedirects as e:
1893 unmodified lines
modified:requirements.txt+1 added-1 removed
2 unmodified lines
3coverage==4.0.34decorator==4.0.95docutils==0.126Flask==0.10.17httpbin==0.4.17httpbin==0.5.08itsdangerous==0.249Jinja2==2.810MarkupSafe==0.2311py==1.4.31
13 unmodified lines