DEV Community

Discussion on: How to deploy a strict Content Security Policy (CSP) with Next.js

Collapse
 
guydumais profile image
Guy Dumais

To ensure compatibility with very old browser versions (4+ years), you can add 'unsafe-inline' as a fallback. All recent browsers will ignore 'unsafe-inline' if a CSP nonce or hash is present.

https: and unsafe-inline don't make your policy less safe because they will be ignored by browsers which support strict-dynamic.

Source:
web.dev/strict-csp/#what-is-a-stri...

Collapse
 
grahamthedev profile image
GrahamTheDev

Ah, TIL, thanks!