fix: the returned object key when object is directory (#13391)

This commit is contained in:
jiangfucheng 2021-10-10 11:53:30 -05:00 committed by GitHub
parent a188554fe1
commit ec0fee6208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -900,7 +900,11 @@ func (z *erasureServerPools) DeleteObjects(ctx context.Context, bucket string, o
defer multiDeleteLock.Unlock(lkctx.Cancel) defer multiDeleteLock.Unlock(lkctx.Cancel)
if z.SinglePool() { 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. // 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 { if derr != nil {
derrs[orgIndexes[i]] = derr derrs[orgIndexes[i]] = derr
} }
deletedObjects[i].ObjectName = decodeDirObject(deletedObjects[i].ObjectName)
dobjects[orgIndexes[i]] = deletedObjects[i] dobjects[orgIndexes[i]] = deletedObjects[i]
} }
mu.Unlock() mu.Unlock()