const char c1 = hex_to_num(*src++);
const char c2 = hex_to_num(*src);
if (c1 < 0 || c2 < 0) {
- return std::string();
+ src--;
+ src--; //going back to the %
+ dest_str.push_back(*src); //add % to the target destination string
} else {
dest_str.push_back(c1 << 4 | c2);
}
}
}
-
return dest_str;
}
copy_source_bucket_name = copy_source_bucket_name.substr(0, pos);
#define VERSION_ID_STR "?versionId="
pos = copy_source_object_name.find(VERSION_ID_STR);
- if (pos == std::string::npos) {
- copy_source_object_name = url_decode(copy_source_object_name);
- } else {
+ if (pos != std::string::npos) {
copy_source_version_id =
copy_source_object_name.substr(pos + sizeof(VERSION_ID_STR) - 1);
copy_source_object_name =
- url_decode(copy_source_object_name.substr(0, pos));
+ copy_source_object_name.substr(0, pos);
}
if (copy_source_object_name.empty()) {
- //means url_decode returned empty string so the url is formatted badly
+ //means copy_source_object_name is empty string so the url is formatted badly
ret = -EINVAL;
ldpp_dout(this, 5) << "x-amz-copy-source bad format" << dendl;
return ret;