[Bug]: Stylesheet can't be loaded with a content security policy
gmgarrison opened this issue · comments
What happened?
Using a content security policy, any <script> tags need to also provide a nonce in the tag. It's created with the built-in csp_nonce() function. I found where your style sheet is added with Css::make() but it doesn't look like there's any provision for a nonce there.
Is this just a current limitation of Filament? Do you think there are any easy alternatives for your package if so?
Thank you!
How to reproduce the bug
You need to have an active content security policy in place (which is pretty easy to do with Spatie's CSP package).
Package Version
1.10
PHP Version
8.3
Laravel Version
10.48
Which operating systems does with happen with?
No response
Which browsers does with happen with?
No response
Notes
No response
Ugh - this was all wrong. I looked more closely at the error and it's:
Did not parse stylesheet at '/css/mokhosh/filament-kanban/filament-kanban-styles.css?v=1.11.0.0' because non CSS MIME types are not allowed in strict mode.
Seems like that's an error that maybe that file does not exist? But the styles actually DO load with an active content security policy so I'm closing this (and slapping myself on the wrist).