#1627: httplib now ignores negative Content-Length headers.

This commit is contained in:
Georg Brandl 2008-02-24 00:14:24 +00:00
parent 2363503074
commit 8c460d5241
3 changed files with 12 additions and 0 deletions

View file

@ -184,6 +184,13 @@ class BasicTest(TestCase):
finally:
resp.close()
def test_negative_content_length(self):
sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
resp = httplib.HTTPResponse(sock, method="GET")
resp.begin()
self.assertEquals(resp.read(), 'Hello\r\n')
resp.close()
class OfflineTest(TestCase):
def test_responses(self):