XL: ListObjects should not list when delimiter and prefix are '/'. (#1777)

This commit is contained in:
Harshavardhana
2016-05-27 15:43:51 -07:00
committed by Harshavardhana
parent 27cc8a6529
commit ba8bdec077
3 changed files with 25 additions and 0 deletions
+8
View File
@@ -114,6 +114,14 @@ func (xl xlObjects) ListObjects(bucket, prefix, marker, delimiter string, maxKey
return ListObjectsInfo{}, nil
}
// For delimiter and prefix as '/' we do not list anything at all
// since according to s3 spec we stop at the 'delimiter' along
// with the prefix. On a flat namespace with 'prefix' as '/'
// we don't have any entries, since all the keys are of form 'keyName/...'
if delimiter == slashSeparator && prefix == slashSeparator {
return ListObjectsInfo{}, nil
}
// Over flowing count - reset to maxObjectList.
if maxKeys < 0 || maxKeys > maxObjectList {
maxKeys = maxObjectList