def step.of
import emerging-ezhttp@0.21.0.0/src/step.bend as Stepimport Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
30# a bad request is answered 400 with its reason and never reaches the
31# handler; a good one goes to the handler as it was parsed
32def step.of(req: Http.Request) -> Step:
33 match req:
34 case Http.Bad{why}:
35 Answer{Http.Reply{400, [], why}}
36 case Http.Request{method, target, headers, body}:
37 Call{Http.Request{method, target, headers, body}}