From 8bdc9839594fd010b897863fe60fb8353bb69e02 Mon Sep 17 00:00:00 2001
From: Abner <22141172+Silentely@users.noreply.github.com>
Date: Wed, 24 Jun 2026 19:24:39 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(sentry):=20=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=20CSP=20connect-src=20=E7=BC=BA=E5=B0=91=20sentry.io?=
=?UTF-8?q?=20=E5=9F=BA=E7=A1=80=E5=9F=9F=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 所有 CSP 的 connect-src 添加 https://sentry.io
- *.sentry.io 通配符不匹配基础域名 sentry.io
- showReportDialog 提交反馈时 XHR 被阻止,已修复
---
index.html | 2 +-
netlify.toml | 2 +-
server.js | 2 +-
src/giffgaff/giffgaff_modular.html | 2 +-
src/simyo/simyo_modular.html | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/index.html b/index.html
index 12792c7..da0037b 100644
--- a/index.html
+++ b/index.html
@@ -10,7 +10,7 @@
-
+
eSIM Tools - Giffgaff & Simyo eSIM 在线管理工具 | 设备更换、激活与二维码生成
diff --git a/netlify.toml b/netlify.toml
index 1e3ad6d..9268bb5 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -174,7 +174,7 @@
Referrer-Policy = "strict-origin-when-cross-origin"
# 生产 CSP:包含 unsafe-inline 是因为部分页面仍有内联样式和脚本(如内联 CSS、runtime 兜底脚本),
# 迁移至 nonce/hash 策略需模板注入机制支持,当前暂保留 unsafe-inline
- Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://www.googletagmanager.com https://www.google.com https://www.gstatic.com https://browser.sentry-cdn.com https://sentry.io https://*.sentry.io https://challenges.cloudflare.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://fonts.googleapis.com; img-src 'self' data: https:; connect-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://browser.sentry-cdn.com https://www.google-analytics.com https://analytics.google.com https://stats.g.doubleclick.net https://www.googletagmanager.com https://qrcode.show https://api.qrserver.com https://appapi.simyo.nl https://api.giffgaff.com https://id.giffgaff.com https://publicapi.giffgaff.com https://www.google.com https://www.gstatic.com https://challenges.cloudflare.com https://*.sentry.io; font-src 'self' data: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://fonts.gstatic.com; frame-src 'self' https://challenges.cloudflare.com https://www.google.com https://*.sentry.io; worker-src 'self' blob:; child-src 'self' blob:; manifest-src 'self';"
+ Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://www.googletagmanager.com https://www.google.com https://www.gstatic.com https://browser.sentry-cdn.com https://sentry.io https://*.sentry.io https://challenges.cloudflare.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://fonts.googleapis.com; img-src 'self' data: https:; connect-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://browser.sentry-cdn.com https://www.google-analytics.com https://analytics.google.com https://stats.g.doubleclick.net https://www.googletagmanager.com https://qrcode.show https://api.qrserver.com https://appapi.simyo.nl https://api.giffgaff.com https://id.giffgaff.com https://publicapi.giffgaff.com https://www.google.com https://www.gstatic.com https://challenges.cloudflare.com https://sentry.io https://*.sentry.io; font-src 'self' data: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://fonts.gstatic.com; frame-src 'self' https://challenges.cloudflare.com https://www.google.com https://*.sentry.io; worker-src 'self' blob:; child-src 'self' blob:; manifest-src 'self';"
# Agent 发现 Link 响应头 (RFC 8288)
[[headers]]
diff --git a/server.js b/server.js
index 6242226..d78f41b 100644
--- a/server.js
+++ b/server.js
@@ -62,7 +62,7 @@ app.use(helmet({
scriptSrc: ["'self'", "'unsafe-inline'", "https://cdn.jsdelivr.net", "https://cdnjs.cloudflare.com", "https://browser.sentry-cdn.com", "https://sentry.io", "https://*.sentry.io"],
styleSrc: ["'self'", "'unsafe-inline'", "https://cdn.jsdelivr.net", "https://cdnjs.cloudflare.com", "https://fonts.googleapis.com"],
imgSrc: ["'self'", "data:", "https:", "http:"],
- connectSrc: ["'self'", "https://appapi.simyo.nl", "https://api.giffgaff.com", "https://id.giffgaff.com", "https://publicapi.giffgaff.com", "https://cdn.jsdelivr.net", "https://browser.sentry-cdn.com", "https://*.sentry.io"],
+ connectSrc: ["'self'", "https://appapi.simyo.nl", "https://api.giffgaff.com", "https://id.giffgaff.com", "https://publicapi.giffgaff.com", "https://cdn.jsdelivr.net", "https://browser.sentry-cdn.com", "https://sentry.io", "https://*.sentry.io"],
fontSrc: ["'self'", "https://cdn.jsdelivr.net", "https://cdnjs.cloudflare.com", "https://fonts.gstatic.com"],
frameSrc: ["'self'", "https://*.sentry.io"],
workerSrc: ["'self'", "blob:"],
diff --git a/src/giffgaff/giffgaff_modular.html b/src/giffgaff/giffgaff_modular.html
index ce06153..4226f8c 100644
--- a/src/giffgaff/giffgaff_modular.html
+++ b/src/giffgaff/giffgaff_modular.html
@@ -20,7 +20,7 @@
-
+
Giffgaff eSIM 工具
diff --git a/src/simyo/simyo_modular.html b/src/simyo/simyo_modular.html
index 074c45b..5d11a2c 100644
--- a/src/simyo/simyo_modular.html
+++ b/src/simyo/simyo_modular.html
@@ -46,7 +46,7 @@
-
+
Simyo NL eSIM 工具