-
I played around with setting different CSP for different routes, and noticed that it does not work very well with a SPA. I think the docs should be updated to include a warning about this. Maybe a recommendation should be added, to have the same CSP for the whole website and to not use route rules for CSP. The same applies to other headers too, maybe (like Permission-Policy). This needs further testing. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@vejja You proposed per-route CSP in #291. Could you give some input on whether using different CSP per route works for you during client-side navigation? |
Beta Was this translation helpful? Give feedback.
-
Hi @P4sca1 |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion, because the docs already contain all the information. |
Beta Was this translation helpful? Give feedback.
Hi @P4sca1
You are right that CSP will not be reloaded from a client-side navigation. This is a Nuxt limitation.
As you suggest, our recommendation is therefore to use a single CSP policy for the whole website. Our guidance is provided here :
https://nuxt-security.vercel.app/documentation/advanced/strict-csp#per-route-csp