def parse.short

emerging-ezhttp@0.21.0.0 · src/http.bend:776

import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import Base

776# a body against the length its head promised
777def parse.short(status: U32, headers: List<&2, Header>, n: Nat, body: String,
778  short: Bool) -> Reply:
779  match short:
780    case True{}:
781      Torn{"the response body stopped before its Content-Length"}
782    case False{}:
783      Reply{status, headers, octs.take(body, n)}

Uses (8)

Used by (1)