diff options
author | Quentin <quentin@deuxfleurs.fr> | 2021-08-20 17:38:25 +0200 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2021-08-20 17:38:25 +0200 |
commit | be17ee5a405ceb3945cbaddffb5659e0e6cacdda (patch) | |
tree | 159c7b5973be50c0d1d97e31023b0e547074730d | |
parent | 1cc0de75a671f3b9496ba901abfddae32b316401 (diff) | |
download | bagage-be17ee5a405ceb3945cbaddffb5659e0e6cacdda.tar.gz bagage-be17ee5a405ceb3945cbaddffb5659e0e6cacdda.zip |
Complete Trailing Slashes Fix
-rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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, |