diff --git a/requirements.txt b/requirements.txt index 8426eecb..7f12747c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ coverage==4.0.3 decorator==4.0.9 docutils==0.12 Flask==0.10.1 -httpbin==0.4.1 +httpbin==0.5.0 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 diff --git a/tests/test_requests.py b/tests/test_requests.py index f97558bb..0ed79508 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -165,6 +165,22 @@ class TestRequests: assert r.history[0].status_code == 302 assert r.history[0].is_redirect + def test_HTTP_307_ALLOW_REDIRECT_POST(self, httpbin): + parts = urlparse(httpbin('post')) + url = "HTTP://" + parts.netloc + parts.path + r = requests.post(httpbin('redirect-to'), data='test', params={'url': url, 'status_code': 307}) + assert r.status_code == 200 + assert r.history[0].status_code == 307 + assert r.history[0].is_redirect + + def test_HTTP_307_ALLOW_REDIRECT_POST_WITH_SEEKABLE(self, httpbin): + parts = urlparse(httpbin('post')) + url = "HTTP://" + parts.netloc + parts.path + r = requests.post(httpbin('redirect-to'), data=io.BytesIO(b'test'), params={'url': url, 'status_code': 307}) + assert r.status_code == 200 + assert r.history[0].status_code == 307 + assert r.history[0].is_redirect + def test_HTTP_302_TOO_MANY_REDIRECTS(self, httpbin): try: requests.get(httpbin('relative-redirect', '50'))