Honor standard HTTP headers for sourceIP (#8233)

Behind load balancers we should be tracing sourceIP
preserved by load balancers.
master
Harshavardhana 5 years ago committed by kannappanr
parent 6ba323b009
commit ff6aabd9c0
  1. 3
      cmd/http-tracer.go

@ -30,6 +30,7 @@ import (
"time" "time"
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/handlers"
trace "github.com/minio/minio/pkg/trace" 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, Method: r.Method,
Path: r.URL.Path, Path: r.URL.Path,
RawQuery: r.URL.RawQuery, RawQuery: r.URL.RawQuery,
Client: r.RemoteAddr, Client: handlers.GetSourceIP(r),
Headers: reqHeaders, Headers: reqHeaders,
Body: reqBodyRecorder.Data(), Body: reqBodyRecorder.Data(),
} }

Loading…
Cancel
Save