CORS
after-hook
(Fn [a, b, Response] Response)
(after-hook req params resp)
adds CORS headers to every response.
before-hook
(Fn [(Ref Request a), b] (Maybe Response))
(before-hook req params)
handles CORS preflight OPTIONS requests. Returns a
204 with CORS headers, or Nothing for non-OPTIONS requests.
configure
(Fn [String] ())
(configure allowed-origin)
sets the allowed origin for CORS. Use setup for full
configuration.
set-credentials!
(Fn [Bool] ())
(set-credentials! c)
enables or disables Access-Control-Allow-Credentials.
Origin must not be * when enabled.
set-expose-headers!
(Fn [String] ())
(set-expose-headers! h)
sets the Access-Control-Expose-Headers value.
Pass an empty string to omit (the default).
setup
(Fn [String, String, String, String] ())
(setup o m h ma)
configures CORS origin, methods, headers, and max-age.