1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-10 20:44:02 +00:00

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-07 15:35:41 +02:00
committed by Nick Craig-Wood
parent b8fde4fc46
commit a3f3fc61ee

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)