Skip to content
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: set nonce in response headers instead of using configuration #408

Conversation

huang-julien
Copy link
Contributor

@huang-julien huang-julien commented Apr 1, 2024

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

fix #407

Hey 👋
This PR change the way the SSR CSP plugin works. Before that, it was relying on the configuration.

This Pr moves the replacement of the nonce placeholder to beforeResponse, so it can parse and rewrite the content security policy header after it was set (by runtime hooks and the security configuration/build-time config)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2024 4:27pm

@Baroshem Baroshem changed the base branch from main to chore/1.3.0 April 2, 2024 03:59
@Baroshem
Copy link
Owner

Baroshem commented Apr 2, 2024

Thank you so much @huang-julien for creating this PR! 💚

I will merge it soon and release it with upcoming 1.3.0 version

@Baroshem Baroshem merged commit c1e8bd8 into Baroshem:chore/1.3.0 Apr 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use nonce in nuxt-security:headers hook
2 participants