[]previous and next page

defaultCspDirectives

The strict defaults: same-origin everything, scripts only from this origin or with the nonce, no plugins, no framing, no foreign form targets.

The strict defaults: same-origin everything, scripts only from this origin or with the nonce, no plugins, no framing, no foreign form targets.

Import#

ts
import { defaultCspDirectives } from "@shadow-js/dusk/server";

Signature#

ts
function defaultCspDirectives(): Record<string, readonly string[] | true>

Returns#

A fresh directive map.

Examples#

ts
const directives = { ...defaultCspDirectives(), "img-src": ["'self'", "https://img.example"] };