def cors.preflight.method

emerging-ezhttp@0.21.0.0 · src/cors.bend:173

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

173# 400 when the method is not allowed
174def cors.preflight.method(acao: String, methods: List<&2, String>,
175  +headers: List<&2, String>, credentials: Bool, max_age: String,
176  +req_headers: String, _method: String, ok: Bool) -> Http.Reply:
177  match ok:
178    case False{}:
179      Http.Reply{400, [], ""}
180    case True{}:
181      cors.preflight.headers(acao, methods, headers, credentials, max_age,
182        req_headers, cors.headers_ok(req_headers, headers))

Uses (6)

Used by (1)