From c10ecacf91a95e717a913e08c794f90d668ec61c Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 14 Dec 2019 11:12:59 -0800 Subject: [PATCH] Always use SourceIP for host target filtering (#8649) --- cmd/bucket-notification-handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/bucket-notification-handlers.go b/cmd/bucket-notification-handlers.go index d42797b7a..5e7a5af4d 100644 --- a/cmd/bucket-notification-handlers.go +++ b/cmd/bucket-notification-handlers.go @@ -31,6 +31,7 @@ import ( xhttp "github.com/minio/minio/cmd/http" "github.com/minio/minio/cmd/logger" "github.com/minio/minio/pkg/event" + "github.com/minio/minio/pkg/handlers" xnet "github.com/minio/minio/pkg/net" "github.com/minio/minio/pkg/policy" ) @@ -278,7 +279,7 @@ func (api objectAPIHandlers) ListenBucketNotificationHandler(w http.ResponseWrit return } - host, err := xnet.ParseHost(r.RemoteAddr) + host, err := xnet.ParseHost(handlers.GetSourceIP(r)) if err != nil { writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r)) return