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:
parent
d7ed5b1eae
commit
4eb5d68fbf
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ func RealIpAppenderMiddleware(fieldKey string) func(handler http.Handler) http.H
|
||||||
if IPAddress != "" {
|
if IPAddress != "" {
|
||||||
log := zerolog.Ctx(r.Context())
|
log := zerolog.Ctx(r.Context())
|
||||||
log.UpdateContext(func(c zerolog.Context) zerolog.Context {
|
log.UpdateContext(func(c zerolog.Context) zerolog.Context {
|
||||||
return c.Str(fieldKey, r.RemoteAddr)
|
return c.Str(fieldKey, IPAddress)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
|
|
Loading…
Reference in a new issue