mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-02 12:17:22 -06:00
Fix Google Ana;ytics.
This commit is contained in:
parent
3eb695f2ad
commit
2210b8054d
@ -36,7 +36,7 @@ class SecureHeaders
|
||||
* Handle an incoming request. May not be a limited user (ie. Sandstorm env. or demo user).
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -44,9 +44,11 @@ class SecureHeaders
|
||||
{
|
||||
$response = $next($request);
|
||||
$google = '';
|
||||
$googleImg = '';
|
||||
$analyticsId = config('firefly.analytics_id');
|
||||
if ('' !== $analyticsId) {
|
||||
$google = 'www.googletagmanager.com/gtag/js'; // @codeCoverageIgnore
|
||||
$google = 'www.googletagmanager.com/gtag/js https://www.google-analytics.com/analytics.js'; // @codeCoverageIgnore
|
||||
$googleImg = 'https://www.google-analytics.com/';
|
||||
}
|
||||
$csp = [
|
||||
"default-src 'none'",
|
||||
@ -56,7 +58,7 @@ class SecureHeaders
|
||||
"base-uri 'self'",
|
||||
"font-src 'self' data:",
|
||||
"connect-src 'self'",
|
||||
"img-src 'self' data: https://api.tiles.mapbox.com",
|
||||
sprintf("img-src 'self' data: https://api.tiles.mapbox.com %s", $googleImg),
|
||||
"manifest-src 'self'",
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user