From a3f3fc61ee0ffa0c983b20433c7522cd1e00ac67 Mon Sep 17 00:00:00 2001 From: fhuber Date: Wed, 7 May 2025 15:35:41 +0200 Subject: [PATCH] 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 --- cmd/serve/s3/list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/serve/s3/list.go b/cmd/serve/s3/list.go index f58e95a87..559fa14a4 100644 --- a/cmd/serve/s3/list.go +++ b/cmd/serve/s3/list.go @@ -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)