def cors.preflight.headers

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

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

162# 400 when a requested header is not allowed; otherwise 200
163def cors.preflight.headers(acao: String, methods: List<&2, String>,
164  headers: List<&2, String>, credentials: Bool, max_age: String,
165  _req: String, ok: Bool) -> Http.Reply:
166  match ok:
167    case False{}:
168      Http.Reply{400, [], ""}
169    case True{}:
170      Http.Reply{200, cors.preflight_hs(acao, methods, headers, credentials,
171        max_age), ""}

Uses (5)

Used by (1)