def step.text
import ezhttp@0.22.0.0/src/step.bend as Stepimport Base
import ezhttp@0.22.0.0/src/http.bend as Http
import ezhttp@0.22.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)}