mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Issue #28548: Parse HTTP request version even if too many words received
This commit is contained in:
parent
dc0e6f9ea3
commit
e82338ddab
3 changed files with 31 additions and 15 deletions
|
@ -822,6 +822,16 @@ class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
|
|||
self.assertEqual(result[0], b'<html><body>Data</body></html>\r\n')
|
||||
self.verify_get_called()
|
||||
|
||||
def test_extra_space(self):
|
||||
result = self.send_typical_request(
|
||||
b'GET /spaced out HTTP/1.1\r\n'
|
||||
b'Host: dummy\r\n'
|
||||
b'\r\n'
|
||||
)
|
||||
self.assertTrue(result[0].startswith(b'HTTP/1.1 400 '))
|
||||
self.verify_expected_headers(result[1:result.index(b'\r\n')])
|
||||
self.assertFalse(self.handler.get_called)
|
||||
|
||||
def test_with_continue_1_0(self):
|
||||
result = self.send_typical_request(b'GET / HTTP/1.0\r\nExpect: 100-continue\r\n\r\n')
|
||||
self.verify_http_server_response(result[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue