diff --git a/weed/filer/tikv/tikv_store.go b/weed/filer/tikv/tikv_store.go index 02f7c12b5..9cfcfb927 100644 --- a/weed/filer/tikv/tikv_store.go +++ b/weed/filer/tikv/tikv_store.go @@ -210,7 +210,7 @@ func (store *TikvStore) ListDirectoryEntries(ctx context.Context, dirPath util.F return store.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, "", eachEntryFunc) } -func (store *TikvStore) ListRecursivePrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, delimiter bool, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) { +func (store *TikvStore) ListRecursivePrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, delimiter bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) { return lastFileName, filer.ErrUnsupportedRecursivePrefixed } diff --git a/weed/s3api/s3api_object_handlers_list.go b/weed/s3api/s3api_object_handlers_list.go index 1679b3f34..0a6119432 100644 --- a/weed/s3api/s3api_object_handlers_list.go +++ b/weed/s3api/s3api_object_handlers_list.go @@ -199,17 +199,12 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m } } }() - if delimiter == "/" { - if entry.IsDirectory { - commonPrefixes = append(commonPrefixes, PrefixEntry{ - Prefix: path[len(bucketPrefix):] + "/", - }) - cursor.maxKeys-- - return - // Todo use sql group by dir - } else if isCommonDir { - return - } + if delimiter == "/" && entry.IsDirectory { + commonPrefixes = append(commonPrefixes, PrefixEntry{ + Prefix: path[len(bucketPrefix):] + "/", + }) + cursor.maxKeys-- + return } contents = append(contents, newListEntry(entry, key, "", "", bucketPrefix, fetchOwner, entry.IsDirectoryKeyObject())) cursor.maxKeys--