rclone: Wrong encoding type in response when using "serve s3" - should not be url-encoded
I’m currently testing the rclone serve s3 feature under v1.66 and it works with some clients but not some others. After digging a few hours I noticed that compared to other S3 services (here with MinIO), rclone returns the value inside <Key> (= filenames) as a URL-encoded string, while no <EncodingType> node in the response indicates this content type is in use.
While it’s a bit unclear in the specs, in that case the client should expect a proper UTF-8 string and so it leads to issues when it reuses and re-URL-encode it before sending a HeadObject request for example, because it returns a 404.
The doc says Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. so unless you pass the content-encoding=url parameter in the query, returned filenames should not be encoded that way.
Expected: <Key>Æther Realm/[2011] Odin Will Provide/cover.jpg</Key>
Actual: <Key>%C3%86ther+Realm/%5B2011%5D+Odin+Will+Provide/cover.jpg</Key>
I’ve tried with two different rclone backends: WebDAV and the local filesystem. The result is the same.
The test has been performed with Azuracast, which uses the official aws-sdk-php library for the heavy lifting. We can then assume this is not because of an invalid custom adapter.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
Commits related to this issue
- 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 l... — committed to rclone/rclone by ncw 2 years ago
- 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 l... — committed to rclone/rclone by ncw 2 years ago
- 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 l... — committed to JiaY-shi/rclone by ncw 2 years ago
- 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 l... — committed to rclone/rclone by ncw 2 years ago
- 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 l... — committed to rclone/rclone by ncw 2 years ago
@PatrickHuetter wrote
As you probably know mac is a bit weird about its unicode file names liking to produce denormalised UTF-8.
Not sure which bit of the stack has the problem though! If you’ve made it work, I’m going to leave that can of worms tightly closed 😃