Skip to main content

Module csp

Module csp 

Source
Expand description

Content-Security-Policy construction and nonce generation. CSP nonce generation and policy construction.

Structs§

CspNonce
A validated CSP nonce.
InvalidNonce
Returned by CspNonce::parse for a value that is not safe to interpolate.

Functions§

build_csp_header
Build a strict Content-Security-Policy header value.
generate_csp_nonce
Generate a cryptographically random CSP nonce (base64, 44 chars).