-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Content Security Policy headers (#805)
* Basic CSP with unsafe-inline, unsafe-eval * Allow 'self' for img-src and connect-src Apparently, there is a bug for Chrome on iOS if connect-src does not allow 'self'. See known issues at https://caniuse.com/contentsecuritypolicy * Use nonces for strict CSP * More CSP comments * Add frame-ancestors directive * Add more useful headers * Add HSTS header * Allow youtube and twitter embeds For some reason, www.youtube.com is enough. It also works for youtube.com and youtube-nocookie.com. For twitter embeds from twitter.com or x.com, platform.twitter.com is enough. * Allow CDN and media domain in CSP * Only allow unsafe-eval in dev build * Ignore _next/webpack-hmr in middleware
- Loading branch information
Showing
2 changed files
with
187 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.