summaryrefslogtreecommitdiffstats
path: root/internal/nolog
diff options
context:
space:
mode:
authorGab Virebent <gabriel1@virebent.art>2026-06-20 01:07:45 +0000
committerGab Virebent <gabriel1@virebent.art>2026-06-20 01:07:45 +0000
commitaa459e3b84cc4c5d908f3781c9253848c18640c3 (patch)
tree8454b956cc0fa027034c8291f39d58ece469e10c /internal/nolog
downloadnymdrop-aa459e3b84cc4c5d908f3781c9253848c18640c3.tar.gz
nymdrop-aa459e3b84cc4c5d908f3781c9253848c18640c3.tar.xz
nymdrop-aa459e3b84cc4c5d908f3781c9253848c18640c3.zip
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.
Diffstat (limited to 'internal/nolog')
-rw-r--r--internal/nolog/middleware.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/nolog/middleware.go b/internal/nolog/middleware.go
new file mode 100644
index 0000000..c11ed55
--- /dev/null
+++ b/internal/nolog/middleware.go
@@ -0,0 +1,15 @@
+package nolog
+
+import "net/http"
+
+// Strip all identifying information from every request before any handler sees it.
+func Middleware(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ r.Header.Del("X-Forwarded-For")
+ r.Header.Del("X-Real-IP")
+ r.Header.Del("User-Agent")
+ r.Header.Del("Referer")
+ r.RemoteAddr = "0.0.0.0:0"
+ next.ServeHTTP(w, r)
+ })
+}