fix: X-Frame-Options/frame-ancestors 改为同源以修复条例弹窗空白

This commit is contained in:
qing committed 2026-07-28 11:53:35 +08:00
1 parent 680d28b616
commit 50f209e84a
5 files changed
+12 -11

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ def apply_security_headers(app, csp_policy=None):
@app.after_request
def set_security_headers(response):
# Prevent clickjacking
response.headers['X-Frame-Options'] = 'DENY'
response.headers['X-Frame-Options'] = 'SAMEORIGIN'
# XSS protection (legacy browsers)
response.headers['X-XSS-Protection'] = '1; mode=block'
# Prevent MIME type sniffing
@@ -33,7 +33,7 @@ def apply_security_headers(app, csp_policy=None):
"img-src 'self' data: blob:; "
"font-src 'self'; "
"connect-src 'self'; "
"frame-ancestors 'none'"
"frame-ancestors 'self'"
)
# Remove server header info