Skip to content

Commit d9d80c9

Browse files
committed
fix: add 'self' to script-src/style-src and cdn.jsdelivr.net to connect-src in CSP
1 parent e3916b2 commit d9d80c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/middleware/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func SecurityHeaders(next http.Handler) http.Handler {
2222
w.Header().Set("X-DNS-Prefetch-Control", "off")
2323
w.Header().Set("Permissions-Policy", "camera=(), microphone=(), geolocation=()")
2424
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
25-
w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com; style-src 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' https://img.zero-host.org data:; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://cap.zero-host.org; frame-src blob:; worker-src blob:; base-uri 'self'; form-action 'self'")
25+
w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' https://img.zero-host.org data:; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://cap.zero-host.org https://cdn.jsdelivr.net; frame-src 'self' blob:; worker-src 'self' blob:; base-uri 'self'")
2626
next.ServeHTTP(w, r)
2727
})
2828
}

0 commit comments

Comments
 (0)