mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed #14664 - allow additional urls in env for CSP
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
7fdbbc846e
commit
ca1555d962
|
@ -88,13 +88,13 @@ class SecurityHeaders
|
|||
$csp_policy[] = "connect-src 'self'";
|
||||
$csp_policy[] = "object-src 'none'";
|
||||
$csp_policy[] = "font-src 'self' data:";
|
||||
$csp_policy[] = "img-src 'self' data: ".config('app.url').' '.env('PUBLIC_AWS_URL').' https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com';
|
||||
$csp_policy[] = "img-src 'self' data: ".config('app.url').' '.config('app.additional_csp_urls').' '.env('PUBLIC_AWS_URL').' https://secure.gravatar.com http://gravatar.com maps.google.com maps.gstatic.com *.googleapis.com';
|
||||
|
||||
if (config('filesystems.disks.public.driver') == 's3') {
|
||||
$csp_policy[] = "img-src 'self' data: ".config('filesystems.disks.public.url');
|
||||
}
|
||||
$csp_policy = join(';', $csp_policy);
|
||||
|
||||
|
||||
$response->headers->set('Content-Security-Policy', $csp_policy);
|
||||
}
|
||||
|
||||
|
|
|
@ -201,6 +201,9 @@ return [
|
|||
|
||||
'enable_csp' => env('ENABLE_CSP', true),
|
||||
|
||||
'additional_csp_urls' => env('ADDITIONAL_CSP_URLS', ''),
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue