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

Support for strict CSP on static pages #78

Open
prichey opened this issue Jul 24, 2023 · 0 comments
Open

Support for strict CSP on static pages #78

prichey opened this issue Jul 24, 2023 · 0 comments

Comments

@prichey
Copy link

prichey commented Jul 24, 2023

First of all, thanks for the library - I have enjoyed using it on a variety of pages and find it works very well for my purposes.

I have ran into an issue in using it on static pages, though, due to a strict CSP which prevents unsafe-eval. I am aware of the nonce prop which was introduced in #61 - this works well for SSR pages, but as I understand it does not work for static pages, because a nonce should differ per request.

What is the recommended solution in this situation? I understand a hash is difficult to implement since the injected scripts will vary in number and content. Would it be possible to introduce a prop that disables injecting the script on static pages, such that the balancer only runs at build time?

I'm happy to help collaborate on a solution for this if there's agreement about the correct solution. Thanks!

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

No branches or pull requests

1 participant