Module
whiplash/hpack/fields
src/whiplash/hpack/fields.pookaHTTP/2 and HTTP/3 share field semantics even though their framing and compression differ. Validate pseudo-header order, ordinary field tokens, prohibited connection fields, whitespace/controls, and Content-Length here. RFC 9113 section 8.2 and RFC 9114 section 4.2 use the same HTTP vocabulary.
API reference
request_checked(fields: List(hpack.Field), extended: Bool) -> Result(Int, Nil)
fn(List(whiplash/hpack.Field), Bool) -> Result(Int, Nil)request for fields hpack.decode_checked has already found valid: only
the pseudo-header and connection-specific rules remain.
request(fields: List(hpack.Field), extended: Bool) -> Result(Int, Nil)
fn(List(whiplash/hpack.Field), Bool) -> Result(Int, Nil)trailers(fields: List(hpack.Field)) -> Result(Nil, Nil)
fn(List(whiplash/hpack.Field)) -> Result(Nil, Nil)Trailers carry ordinary fields only; they cannot change message framing.
response(fields: List(hpack.Field)) -> Result(Int, Nil)
fn(List(whiplash/hpack.Field)) -> Result(Int, Nil)Ordinary response fields, with an optional declared body length.
within_limit(fields: List(hpack.Field), limit: Int) -> Bool
fn(List(whiplash/hpack.Field), Int) -> BoolBound the normalised field list, including per-field metadata overhead. Stop counting once the budget is exhausted; repeated indexed fields must not turn a tiny compressed block into an unbounded application request.