cmd serve s3: fix ListObjectsV2 response

add trailing slash to s3 ListObjectsV2 response because some clients expect a trailing forward slash to distinguish if the returned object is a directory

Fixes #8464
This commit is contained in:
fhuber
2025-05-22 22:27:38 +01:00
committed by Nick Craig-Wood
parent b8fde4fc46
commit a3f3fc61ee
+2 -1
View File
@@ -28,7 +28,8 @@ func (b *s3Backend) entryListR(_vfs *vfs.VFS, bucket, fdPath, name string, addPr
if entry.IsDir() {
if addPrefix {
response.AddPrefix(objectPath)
prefixWithTrailingSlash := objectPath + "/"
response.AddPrefix(prefixWithTrailingSlash)
continue
}
err := b.entryListR(_vfs, bucket, path.Join(fdPath, object), "", false, response)