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

Inline script detection fails when newline is inside script #482

Closed
Gerbuuun opened this issue Jun 23, 2024 · 4 comments
Closed

Inline script detection fails when newline is inside script #482

Gerbuuun opened this issue Jun 23, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Gerbuuun
Copy link

Gerbuuun commented Jun 23, 2024

Version

nuxt-security: 2.0.0.rc6
nuxt: 3.12.2

Steps to reproduce

  • Add @nuxtjs/color-mode and nuxt-security modules
  • enforce strict CSP
  • Prerender the page

What is Expected?

The injected color-mode script also receives a hash during SSG

What is actually happening?

The regexp responsible for detecting scripts does not detect the color-mode script because it has a newline character at the end.
See my comments here: nuxt-modules/color-mode#266 (and PR nuxt-modules/color-mode#268)

This behavior will break @nuxt/ui and @nuxt/ui-pro in SSG because it uses @nuxtjs/color-mode.

@vejja
Copy link
Collaborator

vejja commented Jun 23, 2024

Think PR #478 will fix

@Baroshem
Copy link
Collaborator

Merged the PR that was supposed to resolve it. @Gerbuuun could you check if with the newest version of the module the problem is still there? :)

@Gerbuuun
Copy link
Author

@Baroshem Yes, it definitely works now! A hotfix has also been pushed to @nuxtjs/color-mode but not yet released.

@Baroshem
Copy link
Collaborator

Awesome, thanks for leeting me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants