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

feat(csp): support style nonce in development #475

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dargmuesli
Copy link
Contributor

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

Allows to use "'nonce-{{nonce}}'" placeholder on style-src policy in development.
Resolves discussion #454.

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)

Not sure how to run tests for development mode.

Copy link

vercel bot commented Jun 12, 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 Jun 12, 2024 10:08am

@dargmuesli
Copy link
Contributor Author

@vejja @GalacticHypernova would you be so kind to review? 🙏

@dargmuesli
Copy link
Contributor Author

I've tested this change in my projects and it works fine. Without this change having a nonce in style-src results in
image
With this change there is no such error in development any more 🥳

@GalacticHypernova
Copy link
Contributor

GalacticHypernova commented Jun 12, 2024

Seems good to me at a first glance, will do some local testing soon. Thanks for making this PR! I was planning on making it but got a little busy with life.

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.

None yet

2 participants