Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(74142)

Unified Diff: Lib/test/test_httplib.py

Issue 16037: httplib: header parsing is not delimited
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/httplib.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_httplib.py Fri Aug 01 23:51:51 2014 -0700
+++ b/Lib/test/test_httplib.py Sat Aug 02 13:59:25 2014 +0000
@@ -262,6 +262,13 @@
if resp.read() != "":
self.fail("Did not expect response from HEAD request")
+ def test_too_many_headers(self):
+ headers = '\r\n'.join('Header%d: foo' % i for i in xrange(200)) + '\r\n'
+ text = ('HTTP/1.1 200 OK\r\n' + headers)
+ s = FakeSocket(text)
+ r = httplib.HTTPResponse(s)
+ self.assertRaises(httplib.HTTPException, r.begin)
+
def test_send_file(self):
expected = 'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \
'Accept-Encoding: identity\r\nContent-Length:'
« no previous file with comments | « Lib/httplib.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+