Skip to content
Myr

Potential fix for #436

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

authored by Chris Dary · committed by Chris Dary · parent 1cf5ec8 · Browse files · 2 files+7 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+7 added−1 removed

  • tests:+4 added−1 removed
  • other:+3 added−0 removed

2 files+7 added−1 removed

modified:requests/models.py+3 added
673 unmodified lines
674 fp.read(2) # throw away crlf675 while 1:676 #XXX correct line size? (httplib has 64kb, seems insane)677 pending_bytes = fp.readline(40).strip()678 if pending_bytes == '':679 # No content, like a HEAD request. Break out.680 break681 pending_bytes = int(pending_bytes, 16)682 if pending_bytes == 0:683 break684 while pending_bytes:
119 unmodified lines
modified:tests/test_requests.py+4 added-1 removed
795 unmodified lines
796 def test_empty_response(self):797 r = requests.get(httpbin('status', '404'))798 r.text799800 def test_chunked_head_redirect(self):801 u = "http://t.co/NFrx0zLG"802 r = requests.head(u, allow_redirects=True)803 self.assertEqual(r.status_code, 200)804801805if __name__ == '__main__':806 unittest.main()