-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: csp false in rc5 removes custom csp header #321
Comments
What are your thoughts on that? I think we recently had a PR where we were changing the boolean values for headers |
@dargmuesli you're right. Setting However we could change this. It could mean 'do not set a CSP header'. |
I'm about to patch this. Just for clarity, the behavior is specific to
This would revert to rc-4 behaviour. @dargmuesli @Baroshem : do you agree this is the intended behavior ? |
Yes, I understand the module as a helper to set values. In the best case it should be possible to disable single features of modules, e.g. to be able to use a custom implementation. |
Guys I am not sure about this change. CSP is set by default when NuxtSecurity is added. I would expect when setting a csp to false that this csp wont be included at all. Like with middleware (i.e. rateLimiter). If I dont want it I just set it to false and this middleware wont be enabled. I think that the behavior in rc.4 was actually a bug and with rc.5 it is now correct. But honestly, I am not sure if I understand your use case @dargmuesli. Why setting header in server middleware if you can just do it in the nuxt security? |
Right, but should it just not be enabled or should any such header be removed even if it has another source?
Because I cannot! 😂 I'm waiting for runtime support (#233, #298). |
I do agree with @dargmuesli What I am doing in rc.5 is aggressively removing the 'Content-Security-Policy' header from the response with Maybe the user wants to use |
Ahhh I see. Now it makes sense for me. Thanks for clarification guys! |
Reproduction Link
Build: https://github.com/maevsi/maevsi/actions/runs/7138462986/job/19440077662?pr=1475
PR: maevsi/maevsi#1475
Steps to reproduce
Set
content-security-policy
header usingappendHeader
in a server middleware and setcontentSecurityPolicy: false
for this module.What is Expected?
Up until rc4 the csp set in the server middleware was applied and this module's default csp was not used.
What is actually happening?
There is no csp header at all in rc5. Seems like the existing header is removed when set to false?
The text was updated successfully, but these errors were encountered: