CSP remove unrequired policies
This commit is contained in:
parent
74dc29781b
commit
cdd69b66d0
1 changed files with 3 additions and 4 deletions
|
|
@ -32,7 +32,7 @@ class SecureHeaders
|
|||
{
|
||||
View::share('nonce', $nonce = \uniqid());
|
||||
// * For VueJS dev tool to execute
|
||||
$jsDev = config('app.debug') ? "'unsafe-eval' 'unsafe-inline'" : '';
|
||||
$jsDev = config('app.debug') ? "'unsafe-eval' 'unsafe-inline'" : "'nonce-{$nonce}' 'strict-dynamic'";
|
||||
$scheme = config('app.env') === 'local' ? 'http' : 'https';
|
||||
$reportUri = Route::has('cspReportUri') ?
|
||||
\sprintf(' report-uri %s ;', \parse_url(route('cspReportUri'), \PHP_URL_PATH)) : '';
|
||||
|
|
@ -68,9 +68,8 @@ class SecureHeaders
|
|||
// ! If you dont use ckeditor use this
|
||||
// "style-src 'self' 'nonce-$nonce';",
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
"script-src 'self' {$jsDev} 'nonce-{$nonce}' " . \implode(' ', [
|
||||
// '\'strict-dynamic\' https: blob:',
|
||||
'\'strict-dynamic\' https: blob: \'unsafe-eval\'',
|
||||
"script-src 'self' {$jsDev} " . \implode(' ', [
|
||||
'https: blob:',
|
||||
'https://www.googletagmanager.com',
|
||||
'https://cdnjs.cloudflare.com',
|
||||
"$scheme://www.google-analytics.com",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue