cheroot.test.test_duplicate_content_length module

Reject ambiguous HTTP request body lengths.

class cheroot.test.test_duplicate_content_length._AcceptedGateway(req)

Bases: Gateway

Acknowledge requests that reach the application.

respond() → None

Send an empty successful response.

cheroot.test.test_duplicate_content_length.test_duplicate_content_length(native_server: HTTPServer, http_request_timeout: float, header_lines: bytes, expected_status: HTTPStatus) → None

Reject duplicate lengths and close before any pipelined request.

Parameters:
  • native_server – live HTTP server

  • http_request_timeout – socket timeout in seconds

  • header_lines – length fields to send on the wire

  • expected_status – response required by the framing rules