laravel-debugbar icon indicating copy to clipboard operation
laravel-debugbar copied to clipboard

style-src CSP errors in 3.13.5

Open jamiethorpe opened this issue 1 year ago • 1 comments

This may be a regression coming from the base php debugbar package.

To replicate, add 'self' and a nonce to style-src in your Content-Security-Policy. Then add the nonce to debugbar:

if (app()->bound('debugbar')) {
    $debugbar = app(LaravelDebugbar::class);
    $renderer = $debugbar->getJavascriptRenderer();
    $renderer->setCspNonce(app('csp-nonce'));
}

You should see an error related to style-src upon loading any page with debugbar present.

This issue is not present in 3.12.2.

jamiethorpe avatar Sep 04 '24 17:09 jamiethorpe

Feel free to make a PR with the fix 👍

parallels999 avatar Sep 04 '24 22:09 parallels999