serve s3: fix list objects encoding-type

Before this change rclone would always use encoding-type url even if
the client hadn't asked for it.

This confused some clients.

This fixes the problem by leaving the URL encoding to the gofakes3
library which has also been fixed.

Fixes #7836
This commit is contained in:
Nick Craig-Wood
2024-12-28 16:29:55 +00:00
parent 11ba4ac539
commit 5039747f26
4 changed files with 10 additions and 7 deletions

View File

@ -52,7 +52,7 @@ func (b *s3Backend) ListBuckets(ctx context.Context) ([]gofakes3.BucketInfo, err
for _, entry := range dirEntries {
if entry.IsDir() {
response = append(response, gofakes3.BucketInfo{
Name: gofakes3.URLEncode(entry.Name()),
Name: entry.Name(),
CreationDate: gofakes3.NewContentTime(entry.ModTime()),
})
}
@ -227,7 +227,7 @@ func (b *s3Backend) GetObject(ctx context.Context, bucketName, objectName string
}
return &gofakes3.Object{
Name: gofakes3.URLEncode(objectName),
Name: objectName,
Hash: hash,
Metadata: meta,
Size: size,