def cors.is_preflight
import emerging-ezhttp@0.21.0.0/src/cors.bend as Corsimport Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
265# whether this request is a CORS preflight
266def cors.is_preflight(req: Http.Request) -> Bool:
267 match req:
268 case Http.Bad{why}:
269 False{}
270 case Http.Request{method, target, headers, body}:
271 cors.is_preflight.method(method,
272 Http.headers.find(headers, "access-control-request-method"))