From c526e76d3b12bc326be6eaa12862461a12ba591a Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Tue, 19 May 2026 12:53:36 -0500 Subject: [PATCH] Allow Google Analytics and Ads domains in CSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add to connect-src: analytics.google.com, www.google.com, www.googletagmanager.com — required for GA event beacons and Google Ads conversion/remarketing collect endpoints. Add to script-src: googleads.g.doubleclick.net — required for Google Ads conversion tag script injection via GTM. --- src/main.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.el b/src/main.el index 1d5ede5..ef2ef1c 100644 --- a/src/main.el +++ b/src/main.el @@ -2317,7 +2317,7 @@ fn sec_headers_json() -> String { + "\"X-Frame-Options\":\"SAMEORIGIN\"," + "\"Referrer-Policy\":\"strict-origin-when-cross-origin\"," + "\"Permissions-Policy\":\"geolocation=(), microphone=(), camera=()\"," - + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://api.stripe.com https://*.supabase.co; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" + + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://googleads.g.doubleclick.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://analytics.google.com https://api.stripe.com https://*.supabase.co https://www.google.com https://www.googletagmanager.com; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" } // Headers for compiled JS assets. Explicitly sets Content-Type so the browser @@ -2333,7 +2333,7 @@ fn js_headers_json() -> String { + "\"X-Frame-Options\":\"SAMEORIGIN\"," + "\"Referrer-Policy\":\"strict-origin-when-cross-origin\"," + "\"Permissions-Policy\":\"geolocation=(), microphone=(), camera=()\"," - + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://api.stripe.com https://*.supabase.co; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" + + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://googleads.g.doubleclick.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://analytics.google.com https://api.stripe.com https://*.supabase.co https://www.google.com https://www.googletagmanager.com; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" } // Headers for static assets under /assets/ and /brand/. @@ -2349,7 +2349,7 @@ fn static_asset_headers_json() -> String { + "\"X-Frame-Options\":\"SAMEORIGIN\"," + "\"Referrer-Policy\":\"strict-origin-when-cross-origin\"," + "\"Permissions-Policy\":\"geolocation=(), microphone=(), camera=()\"," - + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://api.stripe.com https://*.supabase.co; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" + + "\"Content-Security-Policy\":\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://cdn.jsdelivr.net https://googleads.g.doubleclick.net https://js.stripe.com https://static.cloudflareinsights.com https://www.googletagmanager.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; frame-src https://challenges.cloudflare.com https://js.stripe.com; connect-src 'self' https://analytics.google.com https://api.stripe.com https://*.supabase.co https://www.google.com https://www.googletagmanager.com; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com\"}" } fn handle_request(method: String, path: String, headers: Map, body: String) -> String {