(self)
| 387 | self.assertEqual(lines[3], "header: Second: val2") |
| 388 | |
| 389 | def test_max_response_headers(self): |
| 390 | max_headers = client._MAXHEADERS + 20 |
| 391 | headers = [f"Name{i}: Value{i}".encode() for i in range(max_headers)] |
| 392 | body = b"HTTP/1.1 200 OK\r\n" + b"\r\n".join(headers) |
| 393 | |
| 394 | with self.subTest(max_headers=None): |
| 395 | sock = FakeSocket(body) |
| 396 | resp = client.HTTPResponse(sock) |
| 397 | with self.assertRaisesRegex( |
| 398 | client.HTTPException, f"got more than 100 headers" |
| 399 | ): |
| 400 | resp.begin() |
| 401 | |
| 402 | with self.subTest(max_headers=max_headers): |
| 403 | sock = FakeSocket(body) |
| 404 | resp = client.HTTPResponse(sock) |
| 405 | resp.begin(_max_headers=max_headers) |
| 406 | |
| 407 | def test_max_connection_headers(self): |
| 408 | max_headers = client._MAXHEADERS + 20 |
nothing calls this directly
no test coverage detected