-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: link script in head for CSP 'self' compliance in v3 #266
Comments
Ah perhaps this is the issue I'm having too. I noticed I was getting "Refused to execute inline script because it violates the following Content Security Policy directive" errors in the console. After commenting out the I tried keeping the color module and commented out So it seems that using |
After my investigation, this seems to be the culprit of the problems I'm having. (described in #228 and #267) |
Ok I went deep into
It turns out that the newline breaks the detection from Now I don't know which of the two need to be fixed (in my opinion probably both right?) edit: @Baroshem what do you think about this? |
The Nuxt Security part was fixed. Thanks for reporting that :) |
Is your feature request related to a problem? Please describe.
I'd like to not have any inline scripts to enforce a strict Content Security Policy.
Describe the solution you'd like
The color-mode
script
should not be inlined as done herecolor-mode/src/runtime/nitro-plugin.ts
Line 7 in 65c90d4
Describe alternatives you've considered
Set
script-src: 'unsafe-inline'
(which is unsafe)Additional context
This was previously done for Nuxt 2 here:
color-mode/src/runtime/nitro-plugin.ts
Line 7 in 65c90d4
The text was updated successfully, but these errors were encountered: