mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
16 lines
399 B
Go
16 lines
399 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:;",
|
|
)
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|