xl: Fix removing an empty directory (#6421)

Removing an empty directory is not working because of xl.DeleteObject()
was only checking if the passed prefix is an actual object but it
should also check if it is an empty directory.
This commit is contained in:
Anis Elleuch
2018-09-06 01:38:03 +02:00
committed by Harshavardhana
parent 631c78e655
commit 1961f2ef54
5 changed files with 172 additions and 20 deletions

View File

@@ -843,7 +843,7 @@ func (xl xlObjects) DeleteObject(ctx context.Context, bucket, object string) (er
return err
}
if !xl.isObject(bucket, object) {
if !xl.isObject(bucket, object) && !xl.isObjectDir(bucket, object) {
return ObjectNotFound{bucket, object}
}