fix(webrtc): update CSP to allow background processor wasm and blob execution

This commit is contained in:
2026-07-06 13:14:27 +00:00
parent 2631e6ce4a
commit e10cb22811
+8 -2
View File
@@ -11,8 +11,14 @@ func SecurityHeaders(next http.Handler) http.Handler {
w.Header().Set("X-Frame-Options", "DENY") w.Header().Set("X-Frame-Options", "DENY")
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin") w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
w.Header().Set("Content-Security-Policy", w.Header().Set("Content-Security-Policy",
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; "+ "default-src 'self'; "+
"img-src 'self' https: data:; connect-src 'self' wss: ws:; font-src 'self';") "script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' blob: https://cdn.jsdelivr.net https://unpkg.com; "+
"worker-src 'self' blob:; "+
"child-src 'self' blob:; "+
"style-src 'self' 'unsafe-inline'; "+
"img-src 'self' https: data: blob:; "+
"connect-src 'self' wss: ws: https:; "+
"font-src 'self';")
w.Header().Set("Permissions-Policy", "camera=(self), microphone=(self), geolocation=()") w.Header().Set("Permissions-Policy", "camera=(self), microphone=(self), geolocation=()")
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
}) })