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.
This commit is contained in:
Harshavardhana 2023-06-18 07:09:20 -07:00 committed by GitHub
parent 64de61d15d
commit 6806537eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}