Skip to main content

Module http1

Module http1 

Source
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§

AbsoluteTarget
Authority
Header
OriginTarget
RequestHead

Enums§

BodyFraming
Http1Error
HttpVersion
RequestTarget
Scheme

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-* and X-HNS-* fields, standard hop-by-hop fields, and fields nominated by Connection/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.