def sv.hit
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
5819# RFC 6585 §5: refuse a head over the configured byte limit.
5820def sv.hit(+max: Nat, +headers: U32, +len: U32, buf: Bytes.Bytes, at: Maybe<&2, U32>) -> Turn:
5821 match at:
5822 case None{}:
5823 sv.hit.none(U32.is_lt(headers, len), buf)
5824 case Some{+i}:
5825 +hlen = (i + 4 : U32)
5826 sv.hit.some(U32.is_lt(headers, hlen), max, hlen, len, buf)