mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-18 21:26:56 +00:00
Fix toFilerPath: remove URL escaping for raw file paths
The toFilerPath function should return raw file paths, not URL-escaped paths. URL escaping was needed when the path was embedded in a URL (old toFilerUrl), but now that we pass paths directly to putToFiler, they should be unescaped. This fixes S3 integration test failures: - test_bucket_listv2_encoding_basic - test_bucket_list_encoding_basic - test_bucket_listv2_delimiter_whitespace - test_bucket_list_delimiter_whitespace The tests were failing because paths were double-encoded (escaped when stored, then escaped again when listed), resulting in %252B instead of %2B for '+' characters. Root cause: When we removed URL parsing in putToFiler, we should have also removed URL escaping in toFilerPath since paths are now used directly without URL encoding/decoding.
This commit is contained in:
@@ -405,7 +405,9 @@ func newListEntry(entry *filer_pb.Entry, key string, dir string, name string, bu
|
||||
}
|
||||
|
||||
func (s3a *S3ApiServer) toFilerPath(bucket, object string) string {
|
||||
object = urlPathEscape(removeDuplicateSlashes(object))
|
||||
// Returns the raw file path - no URL escaping needed
|
||||
// The path is used directly, not embedded in a URL
|
||||
object = removeDuplicateSlashes(object)
|
||||
return fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user