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

This commit is contained in:
Harshavardhana authored and Harshavardhana committed 2016-05-28 15:15:53 -07:00
1 parent 27cc8a6529
commit ba8bdec077
3 files changed
+25

No files matched your search

+9
View File
@@ -338,6 +338,15 @@ func (fs fsObjects) listObjectsFS(bucket, prefix, marker, delimiter string, maxK
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