Honor standard HTTP headers for sourceIP (#8233)

Behind load balancers we should be tracing sourceIP
preserved by load balancers.
This commit is contained in:
Harshavardhana 2019-09-12 15:29:59 -07:00 committed by kannappanr
parent 6ba323b009
commit ff6aabd9c0

View File

@ -30,6 +30,7 @@ import (
"time"
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/handlers"
trace "github.com/minio/minio/pkg/trace"
)
@ -200,7 +201,7 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ
Method: r.Method,
Path: r.URL.Path,
RawQuery: r.URL.RawQuery,
Client: r.RemoteAddr,
Client: handlers.GetSourceIP(r),
Headers: reqHeaders,
Body: reqBodyRecorder.Data(),
}