Skip to main content

CSP

Content Security Policy constants for directive values and special tokens.

Attributes

AttributeTypeDescription
HEADER_ENFORCEstring = Content-Security-PolicyThe standard HTTP header name used to enforce Content Security Policy restrictions.
HEADER_REPORT_ONLYstring = Content-Security-Policy-Report-OnlyThe HTTP header name used to monitor policy violations without enforcing them.
NONEstring = 'none'The 'none' source expression indicating that no URLs match the directive.
REPORT_SAMPLEstring = 'report-sample'Directive value that instructs the browser to include a sample of the violating code in the violation report.
SELFstring = 'self'The 'self' source expression referring to the origin from which the protected document is being served.
STRICT_DYNAMICstring = 'strict-dynamic'Directive value that allows scripts to load additional scripts via nonces or hashes while ignoring host-based allowlists.
UNSAFE_EVALstring = 'unsafe-eval'Directive value that allows the use of eval() and similar code-execution methods.
UNSAFE_HASHESstring = 'unsafe-hashes'Directive value that enables the use of hashes for inline event handlers.
UNSAFE_INLINEstring = 'unsafe-inline'Directive value that allows the use of inline resources like inline scripts or styles.
WASM_UNSAFE_EVALstring = 'wasm-unsafe-eval'Directive value that allows the execution of WebAssembly modules.
NONCEstring = < CSP_NONCE_SENTINEL >Special placeholder token that gets replaced by the middleware with a unique, per-request cryptographic nonce.