From 6806537eb3daada3d1133a780fa91f6f7c014445 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 18 Jun 2023 07:09:20 -0700 Subject: [PATCH] event args list for fanOut notification must be sized same (#17450) without this fan-out API can crash if client cancels the on-going request. --- cmd/bucket-handlers.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/bucket-handlers.go b/cmd/bucket-handlers.go index 164ee92c2..f2e5a33ad 100644 --- a/cmd/bucket-handlers.go +++ b/cmd/bucket-handlers.go @@ -1315,6 +1315,16 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h Key: objInfo.Name, Error: errs[i].Error(), }) + + eventArgsList = append(eventArgsList, eventArgs{ + EventName: event.ObjectCreatedPost, + BucketName: objInfo.Bucket, + Object: ObjectInfo{Name: objInfo.Name}, + ReqParams: extractReqParams(r), + RespElements: extractRespElements(w), + UserAgent: fmt.Sprintf("%s MinIO-Fan-Out (failed: %v)", r.UserAgent(), errs[i]), + Host: handlers.GetSourceIP(r), + }) continue }