Fast HTTP/1.1 parser for the sync worker — replaces h11 on the hot path.
Parses request lines and headers directly from bytes using split/index
operations (~3 µs vs ~22 µs for h11) while enforcing the same safety
checks that matter for real-world deployment:
- Method validation (rejects malformed method tokens per RFC 9110)
- Header size limit (prevents memory exhaustion)
- Null byte / control character injection in targets and header names
- Duplicate Content-Length detection (request smuggling vector)
- Duplicate Host detection (request smuggling / routing-desync vector)
- Content-Length + Transfer-Encoding conflict (RFC 7230 §3.3.3)
- Negative or non-numeric Content-Length rejection
- Chunked Transfer-Encoding detection (returns flag so caller can handle)
Not a full HTTP parser — does not handle:
- Chunked body decoding (caller must handle or reject)
- Obs-fold header continuation lines (obsolete since RFC 7230)
- Trailer headers