mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Test case for requests getting stuck on post redirect with seekable stream
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user