Skip to content

.tip

· one of the small things

Ship the Content-Security-Policy as Report-Only first

A CSP missing a single source breaks the page for every user at once. The report-only header logs violations and blocks nothing.

Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' https://cdn.example.com; report-to csp

Run it for a week, read the reports, and add the sources you forgot. Then rename the header, since the policy string stays the same.

securityhttp