metainfo: Fix listing paths (#645)

This commit is contained in:
Egon Elbre 2018-11-14 12:40:53 +02:00 committed by Kaloyan Raev
parent 5cdb03515f
commit 17519a7532

View File

@ -108,6 +108,11 @@ func (db *DB) ListObjects(ctx context.Context, bucket string, options storj.List
return storj.ObjectList{}, errClass.New("invalid direction %d", options.Direction)
}
// TODO: remove this hack-fix of specifying the last key
if options.Cursor == "" && (options.Direction == storj.Before || options.Direction == storj.Backward) {
endBefore = "\x7f\x7f\x7f\x7f\x7f\x7f\x7f"
}
items, more, err := objects.List(ctx, options.Prefix, startAfter, endBefore, options.Recursive, options.Limit, meta.All)
if err != nil {
return storj.ObjectList{}, err