def cors.simple.skip

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

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

225# leave a reply alone when there is nothing to add
226def cors.simple.skip(add: Bool, reply: Http.Reply, hs: List<&2, Http.Header>)
227  -> Http.Reply:
228  match add reply:
229    case False{} r:
230      r
231    case True{} Http.Torn{why}:
232      Http.Torn{why}
233    case True{} Http.Reply{status, headers, body}:
234      Http.Reply{status, List.append(&2, Http.Header, hs, headers), body}

Uses (5)

Used by (1)