def cors.preflight_req
emerging-ezhttp@0.21.0.0 · src/cors.bend:274
import emerging-ezhttp@0.21.0.0/src/cors.bend as Cors
import Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
274
275def cors.preflight_req(cfg: Cfg, req: Http.Request) -> Http.Reply:
276 match req:
277 case Http.Bad{why}:
278 Http.Reply{400, [], why}
279 case Http.Request{method, target, +headers, body}:
280 cors.preflight(cfg, Http.headers.find(headers, "origin"),
281 Http.headers.find(headers, "access-control-request-method"),
282 Http.headers.find(headers, "access-control-request-headers"))