From ec0fee620843cf8f878d19a00d44c016cc2323ab Mon Sep 17 00:00:00 2001 From: jiangfucheng <33349046+jiangfucheng@users.noreply.github.com> Date: Sun, 10 Oct 2021 11:53:30 -0500 Subject: [PATCH] fix: the returned object key when object is directory (#13391) --- cmd/erasure-server-pool.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/erasure-server-pool.go b/cmd/erasure-server-pool.go index 0d61bc29d..b0018fa91 100644 --- a/cmd/erasure-server-pool.go +++ b/cmd/erasure-server-pool.go @@ -900,7 +900,11 @@ func (z *erasureServerPools) DeleteObjects(ctx context.Context, bucket string, o defer multiDeleteLock.Unlock(lkctx.Cancel) if z.SinglePool() { - return z.serverPools[0].DeleteObjects(ctx, bucket, objects, opts) + deleteObjects, dErrs := z.serverPools[0].DeleteObjects(ctx, bucket, objects, opts) + for i := range deleteObjects { + deleteObjects[i].ObjectName = decodeDirObject(deleteObjects[i].ObjectName) + } + return deleteObjects, dErrs } // Fetch location of up to 10 objects concurrently. @@ -954,6 +958,7 @@ func (z *erasureServerPools) DeleteObjects(ctx context.Context, bucket string, o if derr != nil { derrs[orgIndexes[i]] = derr } + deletedObjects[i].ObjectName = decodeDirObject(deletedObjects[i].ObjectName) dobjects[orgIndexes[i]] = deletedObjects[i] } mu.Unlock()