1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

chore(refactor): refactors go code (#2443)

This commit is contained in:
Amir Raminfar
2023-10-24 06:28:16 -07:00
committed by GitHub
parent 74e44bd5f2
commit 2a07ca39db
31 changed files with 18 additions and 22 deletions

12
internal/web/csp.go Normal file
View File

@@ -0,0 +1,12 @@
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 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' gravatar.com data:; manifest-src 'self'; connect-src 'self' api.github.com;")
next.ServeHTTP(w, r)
})
}