mirror of
https://github.com/amir20/dozzle.git
synced 2026-06-23 04:10:12 +00:00
df11cc4740
Push container / Push branches and PRs (push) Has been cancelled
Deploy VitePress site to Pages / build (push) Has been cancelled
Test / Typecheck (push) Has been cancelled
Test / JavaScript Tests (push) Has been cancelled
Test / Go Tests (push) Has been cancelled
Test / Go Staticcheck (push) Has been cancelled
Test / Integration Tests (push) Has been cancelled
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
Adds `font-src 'self' data:;` to the CSP so fonts loaded from data: URIs are no longer blocked. Closes #4777
16 lines
422 B
Go
16 lines
422 B
Go
package web
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func cspHeaders(next http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set(
|
|
"Content-Security-Policy",
|
|
"default-src 'self' 'wasm-unsafe-eval' blob: https://cdn.jsdelivr.net https://*.duckdb.org; style-src 'self' 'unsafe-inline' blob:; img-src 'self' data:; font-src 'self' data:;",
|
|
)
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|