diff --git a/orm/usermodifier.go b/orm/usermodifier.go index f8479126..308b559c 100644 --- a/orm/usermodifier.go +++ b/orm/usermodifier.go @@ -1,7 +1,6 @@ package orm import ( - "log" "net/http" ) @@ -54,12 +53,11 @@ func (um UserModifier) UpdatedBy() *User { func WriteCreator(r *http.Request, modifier Modifier) { modifier.SetCreatorID(getUserIDFromTokenAsUint(r)) modifier.SetCreatorRole(getUserRole(r)) - modifier.SetCreatorIP(r.RemoteAddr) + modifier.SetCreatorIP(r.Header.Get("X-Forwarded-For")) } func WriteUpdater(r *http.Request, modifier Modifier) { modifier.SetUpdaterID(getUserIDFromTokenAsUint(r)) modifier.SetUpdaterRole(getUserRole(r)) - modifier.SetUpdaterIP(r.RemoteAddr) - log.Printf("Forwarded IP address: %v", r.Header.Get("X-Forwarded-For")) + modifier.SetUpdaterIP(r.Header.Get("X-Forwarded-For")) }