Fix google analytics CSP again

This commit is contained in:
Jade Ellis
2024-06-16 18:40:02 +01:00
parent cb70967b5c
commit e5aa809a07
+6 -5
View File
@@ -5,7 +5,8 @@ const cspDirectives = {
'child-src': ["'self'"], 'child-src': ["'self'"],
'connect-src': ["'self'", "https://*.google-analytics.com"], 'connect-src': ["'self'", "https://*.google-analytics.com"],
// 'connect-src': ["'self'", 'ws://localhost:*', 'https://hcaptcha.com', 'https://*.hcaptcha.com'], // 'connect-src': ["'self'", 'ws://localhost:*', 'https://hcaptcha.com', 'https://*.hcaptcha.com'],
'img-src': ["'self'", 'data:'], 'img-src': ["'self'", 'data:',
'https://*.googletagmanager.com'],
'font-src': ["'self'", 'data:'], 'font-src': ["'self'", 'data:'],
'form-action': ["'self'"], 'form-action': ["'self'"],
'frame-ancestors': ["'self'"], 'frame-ancestors': ["'self'"],
@@ -50,10 +51,10 @@ const cspDirectives = {
], ],
'worker-src': ["'self'"], 'worker-src': ["'self'"],
// remove report-to & report-uri if you do not want to use Sentry reporting // remove report-to & report-uri if you do not want to use Sentry reporting
// 'report-to': ["'csp-endpoint'"], // 'report-to': ["'csp-endpoint'"],
// 'report-uri': [ // 'report-uri': [
// `https://sentry.io/api/${process.env.VITE_SENTRY_PROJECT_ID}/security/?sentry_key=${process.env.VITE_SENTRY_KEY}`, // `https://sentry.io/api/${process.env.VITE_SENTRY_PROJECT_ID}/security/?sentry_key=${process.env.VITE_SENTRY_KEY}`,
// ], // ],
}; };
export default cspDirectives; export default cspDirectives;