def sv.hit

bend-kit-http@0.38.5.0 · http.bend:5811

import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

5811# RFC 6585 §5: refuse a head over the configured byte limit.
5812def sv.hit(+max: Nat, +headers: U32, +len: U32, buf: Bytes.Bytes, at: Maybe<&2, U32>) -> Turn:
5813  match at:
5814    case None{}:
5815      sv.hit.none(U32.is_lt(headers, len), buf)
5816    case Some{+i}:
5817      +hlen = (i + 4 : U32)
5818      sv.hit.some(U32.is_lt(headers, hlen), max, hlen, len, buf)

Uses (9)

Used by (1)