forked from TrueCloudLab/frostfs-s3-gw
parent
6ee48fb549
commit
8127d68128
2 changed files with 7 additions and 0 deletions
|
@ -380,6 +380,10 @@ func (h *handler) CompleteMultipartUploadHandler(w http.ResponseWriter, r *http.
|
||||||
errors.GetAPIError(errors.ErrMalformedXML), additional...)
|
errors.GetAPIError(errors.ErrMalformedXML), additional...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(reqBody.Parts) == 0 {
|
||||||
|
h.logAndSendError(w, "invalid xml with parts", reqInfo, errors.GetAPIError(errors.ErrMalformedXML), additional...)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
initPart, err := h.obj.GetUploadInitInfo(r.Context(), uploadInfo)
|
initPart, err := h.obj.GetUploadInitInfo(r.Context(), uploadInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -186,6 +186,9 @@ func (n *layer) CompleteMultipartUpload(ctx context.Context, p *CompleteMultipar
|
||||||
if len(objects) == 1 {
|
if len(objects) == 1 {
|
||||||
obj, err := n.headLastVersionIfNotDeleted(ctx, p.Info.Bkt, p.Info.Key)
|
obj, err := n.headLastVersionIfNotDeleted(ctx, p.Info.Bkt, p.Info.Key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.IsS3Error(err, errors.ErrNoSuchKey) {
|
||||||
|
return nil, errors.GetAPIError(errors.ErrInvalidPart)
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if obj != nil && obj.Headers[UploadIDAttributeName] != "" {
|
if obj != nil && obj.Headers[UploadIDAttributeName] != "" {
|
||||||
|
|
Loading…
Reference in a new issue