-
Notifications
You must be signed in to change notification settings - Fork 41
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
Configure nonce also for preloaded scripts #85
Conversation
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 108 108
Branches 19 19
=========================================
Hits 108 108
Continue to review full report at Codecov.
|
Thanks for the contribution! It looks like you can also use preload links to load web workers, and these should be added to the CSP via the child-src directive. At the moment, this change will always add the nonce to the I think we could solve for this in a few ways:
I'm leaning towards the second given it would result in a correct csp implementation, and is flexible for the future. Do you agree? If so, could you make the change and add tests? Thanks! |
Hey @AnujRNair sorry for getting back so late I somehow missed the notification 🤦 . So if I understand correctly you propose to document possibility to add
In the future we could introduce that If we are on the same page, I will wrap it up with test and we are ready to go 🚀 EDIT: |
Sorry for the delay - yes this is what I was thinking! |
You can generate nonce also for preloaded scripts by using data-csp attribute
Hey @AnujRNair I think this should do the trick 🚀 |
@jukben OK I forked this repo and published it to NPM including this change. GitHub: https://github.com/melloware/csp-webpack-plugin NPM: https://www.npmjs.com/package/@melloware/csp-webpack-plugin |
Summary
Solving #84
Does it make sense for you? Should I write test for this it? 👍
Requirements (place an
x
in each[ ]
)