def step.text

emerging-ezhttp@0.21.0.0 · src/step.bend:19

import emerging-ezhttp@0.21.0.0/src/step.bend as Step
import Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import emerging-ezhttp@0.21.0.0/src/qs.bend as Qs

19# a request received as octets, as text: its method, target, header names
20# and values and body each decoded as UTF-8 (SPEC.md HTTP-SRV-2); a bad one
21# keeps its reason
22def step.text(req: Http.Request) -> Http.Request:
23  match req:
24    case Http.Bad{why}:
25      Http.Bad{why}
26    case Http.Request{method, target, headers, body}:
27      Http.Request{Qs.octets.text(method), Qs.octets.text(target),
28        Qs.octets.headers(headers), Qs.octets.text(body)}

Uses (3)

Used by (1)