Bug #61697
openS3 API may not handle urlencoded paths correctly
0%
Description
First off, I'm not sure if this is an issue of RGW or of the AWS SDK for PHP. I've described the issue in more detail in their repo: https://github.com/aws/aws-sdk-php/issues/2704
In short, there is an error with the UploadPartCopy operation if the path contains spaces and is encoded using PHP's urlencode
function. The error does not occur if rawurlencode
is used. The SDK maintainers said that they could not reproduce the issue (with AWS S3) so it may be specific to RGW S3, which I'm using.
I managed to track the code to the url_decode
function (https://github.com/ceph/ceph/blob/4167b5c7978ef83b2ac80581e387b1fa187f056f/src/rgw/rgw_common.cc#L1720). For my untrained C++ eye it looks like it should handle urlencode
-d strings (as it does something with "+" to " "). However, I wasn't able to test the function.
The strings I tested with the SDK were something like this: "path/i contain spaces.mp4"
. With urlencode
it becomes "path%2Fi+contain+spaces.mp4"
(which fails) and with rawurlencode
it becomes "path%2Fi%20contain%20spaces.mp4"
(which works).
Can anyone please have a look and tell me if it might be an issue of RGW or if it's the SDK's fault?
Updated by Casey Bodley 11 months ago
- Assignee set to Ali Maredia
- Tags set to php