Complete Trailing Slashes Fix

This commit is contained in:
Quentin 2021-08-20 17:38:25 +02:00
parent 1cc0de75a6
commit be17ee5a40

View file

@ -334,10 +334,10 @@ func (gf *GarageFile) readDirRoot(count int) ([]fs.FileInfo, error) {
}
func (gf *GarageFile) readDirChild(count int) ([]fs.FileInfo, error) {
prefix := gf.path.key
if prefix[len(prefix)-1:] != "/" {
prefix = prefix + "/"
}
prefix := gf.path.key
if len(prefix) > 0 && prefix[len(prefix)-1:] != "/" {
prefix = prefix + "/"
}
objs_info := gf.mc.ListObjects(gf.ctx, gf.path.bucket, minio.ListObjectsOptions{
Prefix: prefix,