summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-26 04:31:58 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-01-26 04:31:58 (GMT)
commit60a2f49c8cfeb632d38c7ffb8db622049e760a54 (patch)
tree8336202c76d0838826a8d4d4d35d3d1b97198039 /Lib/test/test_httplib.py
parentb335dfe7fa95c8c68630e8f7dc738c7b66637e87 (diff)
parent155ceaa454ad9a623cade5ed326e6e1e70ce109d (diff)
downloadcpython-60a2f49c8cfeb632d38c7ffb8db622049e760a54.zip
cpython-60a2f49c8cfeb632d38c7ffb8db622049e760a54.tar.gz
cpython-60a2f49c8cfeb632d38c7ffb8db622049e760a54.tar.bz2
merge 3.4 (#19996)
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index b952af2..31d3184 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -190,6 +190,16 @@ class HeaderTests(TestCase):
conn.request('GET', '/foo')
self.assertTrue(sock.data.startswith(expected))
+ def test_malformed_headers_coped_with(self):
+ # Issue 19996
+ body = "HTTP/1.1 200 OK\r\nFirst: val\r\n: nval\r\nSecond: val\r\n\r\n"
+ sock = FakeSocket(body)
+ resp = client.HTTPResponse(sock)
+ resp.begin()
+
+ self.assertEqual(resp.getheader('First'), 'val')
+ self.assertEqual(resp.getheader('Second'), 'val')
+
class BasicTest(TestCase):
def test_status_lines(self):