Content-Security-Policy

Restricts what a browser page may load and run.

Response header (sent by servers) security

How it works

Mostly relevant to HTML. For pure JSON APIs, a restrictive policy such as default-src ’none’; frame-ancestors ’none’ is cheap defence in depth.

Example

Content-Security-Policy: default-src 'none'; frame-ancestors 'none'

See it live: send any request in Endpoint Client and open the Headers tab, where every response header is explained. Specification: W3C CSP3.

Related headers