diff --git a/pkg/gateway/operations/postobject.go b/pkg/gateway/operations/postobject.go index 984512ca551..2dcbac95357 100644 --- a/pkg/gateway/operations/postobject.go +++ b/pkg/gateway/operations/postobject.go @@ -94,6 +94,11 @@ func (controller *PostObject) HandleCompleteMultipartUpload(w http.ResponseWrite _ = o.EncodeError(w, req, err, gatewayErrors.Codes.ToAPIErr(gatewayErrors.ErrInternalError)) return } + err = o.checkIfAbsent(req) + if err != nil { + _ = o.EncodeError(w, req, err, gatewayErrors.Codes.ToAPIErr(gatewayErrors.ErrObjectExists)) + return + } objName := multiPart.PhysicalAddress req = req.WithContext(logging.AddFields(req.Context(), logging.Fields{logging.PhysicalAddressFieldKey: objName})) xmlMultipartComplete, err := io.ReadAll(req.Body)