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)
	})
}
