Skip to content

blackbull.server.parser

blackbull.server.parser

HTTP request parsing into native Connection objects.

Keep framing and field validation in shared grammar helpers. Fast paths may reuse validated bytes but cannot weaken checks or change error scope.

parse_headers(frame)

Build a native HTTP or WebSocket Connection, or None for a malformed head.

The Connection's header names are lowercase tchar, its values carry no edge SP/HTAB and no CTL, host is one valid authority taken from :authority or Host, and scheme is lowercase. None must coincide with frame.malformed; never expose partial connections. Validate required pseudo-fields and request-target octets (RFC 9113 ยง8.3.1) after field-level checks in parse_payload.