Fixes: https://tracker.ceph.com/issues/51715
Signed-off-by: xiangrui meng <mengxr@chinatelecom.cn>
Signed-off-by: yupeng chen <chenyupeng@chinatelecom.cn>
(cherry picked from commit
865d13e9fa043954dce5110f4f8ae693af9604ce)
if (!redirect_info.replace_key_prefix_with.empty()) {
*new_url += redirect_info.replace_key_prefix_with;
- *new_url += key.substr(condition.key_prefix_equals.size());
+ if (key.size() > condition.key_prefix_equals.size()) {
+ *new_url += key.substr(condition.key_prefix_equals.size());
+ }
} else if (!redirect_info.replace_key_with.empty()) {
*new_url += redirect_info.replace_key_with;
} else {