fix(安全): CSP 策略添加 Google Fonts 支持
在 style-src 中添加 fonts.googleapis.com,在 font-src 中添加 fonts.gstatic.com,解决浏览器控制台因 CSP 策略阻止加载 Google Fonts 样式表的错误。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const (
|
|||||||
RunModeSimple = "simple"
|
RunModeSimple = "simple"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DefaultCSPPolicy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
|
const DefaultCSPPolicy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; connect-src 'self' https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
|
||||||
|
|
||||||
// 连接池隔离策略常量
|
// 连接池隔离策略常量
|
||||||
// 用于控制上游 HTTP 连接池的隔离粒度,影响连接复用和资源消耗
|
// 用于控制上游 HTTP 连接池的隔离粒度,影响连接复用和资源消耗
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ security:
|
|||||||
# Enable Content-Security-Policy header
|
# Enable Content-Security-Policy header
|
||||||
enabled: true
|
enabled: true
|
||||||
# Default CSP policy (override if you host assets on other domains)
|
# Default CSP policy (override if you host assets on other domains)
|
||||||
policy: "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
|
policy: "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https:; font-src 'self' data: https://fonts.gstatic.com; connect-src 'self' https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
|
||||||
proxy_probe:
|
proxy_probe:
|
||||||
# Allow skipping TLS verification for proxy probe (debug only)
|
# Allow skipping TLS verification for proxy probe (debug only)
|
||||||
insecure_skip_verify: false
|
insecure_skip_verify: false
|
||||||
|
|||||||
Reference in New Issue
Block a user