(compose policy)
(compose policy nonce)
Make string value for CSP header from policy map
Make string value for CSP header from policy map
(wrap-csp handler
{:keys [policy report-only? policy-generator report-handler report-uri
use-nonce? nonce-generator]
:or {use-nonce? true}})
Middleware that adds Content-Security-Policy header.
Accepts the following options:
:policy - CSP in {directive-name directive-values} format. See README for details.
:report-only? - true if Use Content-Security-Policy-Report-Only Header.
:policy-generator - function that dynamically generate policy map from request.
:report-handler - function that process request and return response.
:report-uri - specify the path to use report-handler.
:use-nonce? - boolean. if true, generate nonce and replace policy value :nonce to nonce-xxxxxxxx
.
default: true
:nonce-generator - custom function that generate nonce string.
default implementation by SecureRandom class.
Middleware that adds Content-Security-Policy header. Accepts the following options: :policy - CSP in {directive-name directive-values} format. See README for details. :report-only? - true if Use Content-Security-Policy-Report-Only Header. :policy-generator - function that dynamically generate policy map from request. :report-handler - function that process request and return response. :report-uri - specify the path to use report-handler. :use-nonce? - boolean. if true, generate nonce and replace policy value :nonce to `nonce-xxxxxxxx`. default: true :nonce-generator - custom function that generate nonce string. default implementation by SecureRandom class.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close