Fix for the fix

I didn't actually write the found ip to the logging stack (or whatever
zerolog uses). This is now fixed
This commit is contained in:
Melody Becker 2025-05-12 15:35:45 +02:00
parent d7ed5b1eae
commit 4eb5d68fbf
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8

View file

@ -91,7 +91,7 @@ func RealIpAppenderMiddleware(fieldKey string) func(handler http.Handler) http.H
if IPAddress != "" {
log := zerolog.Ctx(r.Context())
log.UpdateContext(func(c zerolog.Context) zerolog.Context {
return c.Str(fieldKey, r.RemoteAddr)
return c.Str(fieldKey, IPAddress)
})
}
next.ServeHTTP(w, r)