From d54022b0c0e79d8ae18c6c77e8bc95d471913eeb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 20 May 2015 12:29:09 +0530 Subject: [PATCH] Test for comma separated header parsing --- src/calibre/srv/tests/http.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/srv/tests/http.py b/src/calibre/srv/tests/http.py index cb56b4c442..a7a3089aff 100644 --- a/src/calibre/srv/tests/http.py +++ b/src/calibre/srv/tests/http.py @@ -38,6 +38,12 @@ class TestHTTP(BaseTest): a:mūs\r \r\n''', a='mūs'.encode('utf-8')) + test('Comma-separated parsing', + '''\ + Accept-Encoding: one\r + Accept-Encoding: two\r + \r\n''', accept_encoding='one, two') + with self.assertRaises(ValueError): read_headers(headers('Connection:mūs\r\n').readline) read_headers(headers('Connection\r\n').readline)