If the copysource on copyobject call was URL-encoded, it would fail as it would not parse the '/' seperating bucket and key name
URL encoding may be necessary for certain characters in a copysource, and several public examples show URL encoding the copysource
Fixes: #43259
Signed-off-by: Paul Reece <paul@servercloud.com>
(cherry picked from commit
b7621625ed69f21a5bf701b3385ddee281ff3715)
if (dec_src[0] == '/')
dec_src.remove_prefix(1);
- pos = dec_src.find('/');
+ pos = url_decode(dec_src).find('/');
if (pos == string::npos)
return false;
- bucket_name = url_decode(dec_src.substr(0, pos));
- key.name = url_decode(dec_src.substr(pos + 1));
+ bucket_name = url_decode(dec_src).substr(0, pos);
+ key.name = url_decode(dec_src).substr(pos + 1);
if (key.name.empty()) {
return false;