jaredpalmer / razzle

✨ Create server-rendered universal JavaScript applications with no configuration
https://razzlejs.org
MIT License
11.11k stars 867 forks source link

Content Security Policy Implementation #1911

Open LovishPrajapati opened 1 year ago

LovishPrajapati commented 1 year ago

❓Question

Hey, Can anyone tell me how to implement Content Security Policy in a razzle app using loadable components? I have tried adding helmet middleware for CSP, but it sometimes work and sometime don't. On normal load of site browser does follow policies but as soon as I hard reload the browser it does not. Can anyone help me here???

dmitryshelomanov commented 1 year ago

You no need to implement CSP for static assets, its only for doc

You can use helmet middleware for express or create own header handler