From ff6aabd9c013076aec94831a5e54bdeda9088d52 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 12 Sep 2019 15:29:59 -0700 Subject: [PATCH] Honor standard HTTP headers for sourceIP (#8233) Behind load balancers we should be tracing sourceIP preserved by load balancers. --- cmd/http-tracer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/http-tracer.go b/cmd/http-tracer.go index ef9b89f9f..b9a76da4f 100644 --- a/cmd/http-tracer.go +++ b/cmd/http-tracer.go @@ -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(), }