From 7b165d3f18d3b39a52e6590e76794273910bc73e Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 23 Aug 2022 17:54:24 +0300 Subject: [PATCH] [#671] Fix using nested name in multipart upload Signed-off-by: Denis Kirillov --- internal/neofs/tree.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/neofs/tree.go b/internal/neofs/tree.go index 8110119..6dd0663 100644 --- a/internal/neofs/tree.go +++ b/internal/neofs/tree.go @@ -839,7 +839,7 @@ func (c *TreeClient) RemoveVersion(ctx context.Context, cnrID cid.ID, id uint64) func (c *TreeClient) CreateMultipartUpload(ctx context.Context, cnrID cid.ID, info *data.MultipartInfo) error { path := pathFromName(info.Key) - meta := metaFromMultipart(info) + meta := metaFromMultipart(info, path[len(path)-1]) return c.addNodeByPath(ctx, cnrID, systemTree, path[:len(path)-1], meta) } @@ -1209,8 +1209,8 @@ func metaFromSettings(settings *data.BucketSettings) map[string]string { return results } -func metaFromMultipart(info *data.MultipartInfo) map[string]string { - info.Meta[fileNameKV] = info.Key +func metaFromMultipart(info *data.MultipartInfo, fileName string) map[string]string { + info.Meta[fileNameKV] = fileName info.Meta[uploadIDKV] = info.UploadID info.Meta[ownerKV] = info.Owner.EncodeToString() info.Meta[createdKV] = strconv.FormatInt(info.Created.UTC().UnixMilli(), 10)