Skip to content

remix/headers/content-security-policy · Interface

View Source

ContentSecurityPolicyInit

Summary

Directives for a single Content Security Policy. Values are individual CSP tokens, including quotes.

Signature

interface ContentSecurityPolicyInit {
  baseUri?: readonly string[]
  childSrc?: readonly string[]
  connectSrc?: readonly string[]
  defaultSrc?: readonly string[]
  fontSrc?: readonly string[]
  formAction?: readonly string[]
  frameAncestors?: readonly string[]
  frameSrc?: readonly string[]
  imgSrc?: readonly string[]
  manifestSrc?: readonly string[]
  mediaSrc?: readonly string[]
  objectSrc?: readonly string[]
  reportTo?: string
  reportUri?: readonly string[]
  requireTrustedTypesFor?: readonly string[]
  sandbox?: readonly string[]
  scriptSrc?: readonly string[]
  scriptSrcAttr?: readonly string[]
  scriptSrcElem?: readonly string[]
  styleSrc?: readonly string[]
  styleSrcAttr?: readonly string[]
  styleSrcElem?: readonly string[]
  trustedTypes?: readonly string[]
  upgradeInsecureRequests?: boolean
  workerSrc?: readonly string[]
}

Properties

baseUri

Allowed base element URLs.

childSrc

Allowed worker and nested browsing context sources.

connectSrc

Allowed network connection destinations.

defaultSrc

Fallback sources for fetch directives.

fontSrc

Allowed font sources.

formAction

Allowed form submission destinations.

frameAncestors

Allowed embedding ancestors.

frameSrc

Allowed nested browsing context sources.

imgSrc

Allowed image sources.

manifestSrc

Allowed web app manifest sources.

mediaSrc

Allowed audio and video sources.

objectSrc

Allowed object and embed sources.

reportTo

A single reporting endpoint name, expressed as an HTTP token.

reportUri

Legacy violation reporting URLs.

requireTrustedTypesFor

Trusted Types sink groups, such as "'script'".

sandbox

Sandbox allowances. An empty array enables all sandbox restrictions.

scriptSrc

Allowed script sources.

scriptSrcAttr

Allowed inline script attributes.

scriptSrcElem

Allowed sources for script elements.

styleSrc

Allowed stylesheet sources.

styleSrcAttr

Allowed inline style attributes.

styleSrcElem

Allowed sources for style elements.

trustedTypes

Trusted Types policy names and keywords.

upgradeInsecureRequests

Upgrade insecure resource requests to HTTPS.

workerSrc

Allowed worker sources.