Content security policy nonce for styles #592
duffn
started this conversation in
Feature Requests
Replies: 1 comment
-
I second this! My current workaround for this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First, thanks for the great package.
I'm attempting to use the bootstrap4 theme (though this would happen with bootstrap5, too) along with a content security policy that allows
unsafe-inline
styles withlaravel-csp
: https://github.com/spatie/laravel-cspThis is not possible with the styles in the templates. https://github.com/search?q=style%3D+repo%3Arappasoft%2Flaravel-livewire-tables+extension%3Aphp&type=Code&ref=advsearch&l=&l=
Ideally these would all be in an external stylesheet, but one other potential solution is to convert these to
<style></style>
tags and then provide an option to set a nonce on the style tags like Livewire does here: https://github.com/livewire/livewire/blob/f2e2c341394ee4aec98a28373ca73ba1bf6be450/src/LivewireManager.php#L192-L195. I'm successfully using this functionality with Livewire andlaravel-csp
.If this is a change you'd want, I could take a crack at it.
Beta Was this translation helpful? Give feedback.
All reactions