mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix Google Ana;ytics.
This commit is contained in:
@@ -36,7 +36,7 @@ class SecureHeaders
|
|||||||
* Handle an incoming request. May not be a limited user (ie. Sandstorm env. or demo user).
|
* Handle an incoming request. May not be a limited user (ie. Sandstorm env. or demo user).
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -44,9 +44,11 @@ class SecureHeaders
|
|||||||
{
|
{
|
||||||
$response = $next($request);
|
$response = $next($request);
|
||||||
$google = '';
|
$google = '';
|
||||||
|
$googleImg = '';
|
||||||
$analyticsId = config('firefly.analytics_id');
|
$analyticsId = config('firefly.analytics_id');
|
||||||
if ('' !== $analyticsId) {
|
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 = [
|
$csp = [
|
||||||
"default-src 'none'",
|
"default-src 'none'",
|
||||||
@@ -56,7 +58,7 @@ class SecureHeaders
|
|||||||
"base-uri 'self'",
|
"base-uri 'self'",
|
||||||
"font-src 'self' data:",
|
"font-src 'self' data:",
|
||||||
"connect-src 'self'",
|
"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'",
|
"manifest-src 'self'",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user