Module

whiplash/hpack/fields

src/whiplash/hpack/fields.pooka

HTTP/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

function

request_checked

src/whiplash/hpack/fields.pooka:16
request_checked(fields: List(hpack.Field), extended: Bool) -> Result(Int, Nil)
INFERREDfn(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.

function

request

src/whiplash/hpack/fields.pooka:20
request(fields: List(hpack.Field), extended: Bool) -> Result(Int, Nil)
INFERREDfn(List(whiplash/hpack.Field), Bool) -> Result(Int, Nil)
function

trailers

src/whiplash/hpack/fields.pooka:162
trailers(fields: List(hpack.Field)) -> Result(Nil, Nil)
INFERREDfn(List(whiplash/hpack.Field)) -> Result(Nil, Nil)

Trailers carry ordinary fields only; they cannot change message framing.

function

response

src/whiplash/hpack/fields.pooka:276
response(fields: List(hpack.Field)) -> Result(Int, Nil)
INFERREDfn(List(whiplash/hpack.Field)) -> Result(Int, Nil)

Ordinary response fields, with an optional declared body length.

function

within_limit

src/whiplash/hpack/fields.pooka:289
within_limit(fields: List(hpack.Field), limit: Int) -> Bool
INFERREDfn(List(whiplash/hpack.Field), Int) -> Bool

Bound 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.