Expand description
Strict, bounded HTTP/1 request parsing for the loopback proxy.
This module deliberately reads request heads one byte at a time. A blocking
socket may deliver the head and body together, and consuming past the first
CRLFCRLF would otherwise require a second buffering abstraction at every
call site.
Structs§
Enums§
Constants§
- DEFAULT_
MAX_ REQUEST_ BODY_ BYTES - DEFAULT_
MAX_ REQUEST_ HEAD_ BYTES - MAX_
CHUNK_ LINE_ BYTES - MAX_
CHUNK_ TRAILER_ BYTES - MAX_
REQUEST_ HEADERS
Functions§
- determine_
body_ framing - parse_
request_ head - read_
chunked_ body - read_
request_ body - read_
request_ head - Reads exactly one request head and leaves all body bytes unread.
- sanitize_
forward_ headers - Removes proxy credentials, all
Proxy-*andX-HNS-*fields, standard hop-by-hop fields, and fields nominated byConnection/Proxy-Connection. - sanitize_
upgrade_ forward_ headers - Removes all proxy/internal/framing fields from a WebSocket handshake while preserving end-to-end WebSocket fields and reconstructing the two required hop-by-hop fields canonically.