From f21e4d8781c06c0686f4a8697ce0697f9bf6a5cc Mon Sep 17 00:00:00 2001 From: Gab Virebent Date: Wed, 8 Jul 2026 23:54:25 +0200 Subject: Add Nym community favicon and allow img-src in CSP favicon.ico/32/48 reference the official Nym icon so the site is recognizable as Nym-community. CSP img-src 'self' data: was needed for the PNG variants to load under the strict script-src 'self' policy. --- internal/handler/static.go | 3 +-- static/favicon-32.png | Bin 0 -> 974 bytes static/favicon-48.png | Bin 0 -> 540 bytes static/favicon.ico | Bin 0 -> 15086 bytes static/index.html | 4 ++++ 5 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 static/favicon-32.png create mode 100644 static/favicon-48.png create mode 100644 static/favicon.ico diff --git a/internal/handler/static.go b/internal/handler/static.go index bf2aaec..8e87172 100644 --- a/internal/handler/static.go +++ b/internal/handler/static.go @@ -7,8 +7,7 @@ import ( func Static(dir string) http.Handler { fs := http.FileServer(http.Dir(dir)) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Security headers on every response. - w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'self'; style-src 'self'") + w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'") w.Header().Set("X-Content-Type-Options", "nosniff") w.Header().Set("Referrer-Policy", "no-referrer") w.Header().Set("Permissions-Policy", "geolocation=(), microphone=(), camera=()") diff --git a/static/favicon-32.png b/static/favicon-32.png new file mode 100644 index 0000000..12a9e80 Binary files /dev/null and b/static/favicon-32.png differ diff --git a/static/favicon-48.png b/static/favicon-48.png new file mode 100644 index 0000000..95907b4 Binary files /dev/null and b/static/favicon-48.png differ diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..f1e3c53 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/index.html b/static/index.html index 84264b7..218af7e 100644 --- a/static/index.html +++ b/static/index.html @@ -5,6 +5,10 @@ NymDrop — Secure Submission + + + + -- cgit v1.2.3