mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Potential fix for #436
This commit is contained in:
@@ -675,6 +675,9 @@ class Response(object):
|
||||
while 1:
|
||||
#XXX correct line size? (httplib has 64kb, seems insane)
|
||||
pending_bytes = fp.readline(40).strip()
|
||||
if pending_bytes == '':
|
||||
# No content, like a HEAD request. Break out.
|
||||
break
|
||||
pending_bytes = int(pending_bytes, 16)
|
||||
if pending_bytes == 0:
|
||||
break
|
||||
|
||||
@@ -797,7 +797,10 @@ class RequestsTestSuite(TestSetup, unittest.TestCase):
|
||||
r = requests.get(httpbin('status', '404'))
|
||||
r.text
|
||||
|
||||
|
||||
def test_chunked_head_redirect(self):
|
||||
u = "http://t.co/NFrx0zLG"
|
||||
r = requests.head(u, allow_redirects=True)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user