diff options
-rw-r--r-- | waitress/parser.py | 2 | ||||
-rw-r--r-- | waitress/tests/test_parser.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/waitress/parser.py b/waitress/parser.py index 4106b56..e85ede2 100644 --- a/waitress/parser.py +++ b/waitress/parser.py @@ -293,7 +293,7 @@ def crack_first_line(line): if m.group(3): version = m.group(5) else: - version = None + version = b'' method = m.group(1) # the request methods that are currently defined are all uppercase: diff --git a/waitress/tests/test_parser.py b/waitress/tests/test_parser.py index 801f784..cf4a976 100644 --- a/waitress/tests/test_parser.py +++ b/waitress/tests/test_parser.py @@ -309,9 +309,12 @@ class Test_crack_first_line(unittest.TestCase): result = self._callFUT(b'GET / bleh') self.assertEqual(result, (b'', b'', b'')) + result = self._callFUT(b'GET /info?txtAirPlay&txtRAOP RTSP/1.0') + self.assertEqual(result, (b'', b'', b'')) + def test_crack_first_line_missing_version(self): result = self._callFUT(b'GET /') - self.assertEqual(result, (b'GET', b'/', None)) + self.assertEqual(result, (b'GET', b'/', b'')) class TestHTTPRequestParserIntegration(unittest.TestCase): |