fix: conditional checks write for multipart (#21567)

This commit is contained in:
M Alvee
2025-09-07 09:13:09 -07:00
committed by GitHub
parent 0cde982902
commit 07c3a429bf
5 changed files with 25 additions and 2 deletions

View File

@@ -200,6 +200,9 @@ func (api objectAPIHandlers) NewMultipartUploadHandler(w http.ResponseWriter, r
return
}
if r.Header.Get(xhttp.IfMatch) != "" {
opts.HasIfMatch = true
}
if opts.PreserveETag != "" ||
r.Header.Get(xhttp.IfMatch) != "" ||
r.Header.Get(xhttp.IfNoneMatch) != "" {
@@ -1014,6 +1017,9 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
multipartETag := etag.Multipart(completeETags...)
opts.UserDefined["etag"] = multipartETag.String()
if r.Header.Get(xhttp.IfMatch) != "" {
opts.HasIfMatch = true
}
if opts.PreserveETag != "" ||
r.Header.Get(xhttp.IfMatch) != "" ||
r.Header.Get(xhttp.IfNoneMatch) != "" {