From aa459e3b84cc4c5d908f3781c9253848c18640c3 Mon Sep 17 00:00:00 2001 From: Gab Virebent Date: Sat, 20 Jun 2026 01:07:45 +0000 Subject: Initial public release: Nym-native anonymous submission system End-to-end verified pipeline (browser -> HTTP relay -> Nym mixnet -> reader). Client-side X25519+HKDF+AES-GCM-256, no-log blind relay, AGPL-3.0. --- internal/handler/static.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/handler/static.go (limited to 'internal/handler/static.go') diff --git a/internal/handler/static.go b/internal/handler/static.go new file mode 100644 index 0000000..bf2aaec --- /dev/null +++ b/internal/handler/static.go @@ -0,0 +1,19 @@ +package handler + +import ( + "net/http" +) + +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("X-Content-Type-Options", "nosniff") + w.Header().Set("Referrer-Policy", "no-referrer") + w.Header().Set("Permissions-Policy", "geolocation=(), microphone=(), camera=()") + w.Header().Set("X-Frame-Options", "DENY") + w.Header().Set("Cache-Control", "no-store") + fs.ServeHTTP(w, r) + }) +} -- cgit v1.2.3