From: Chang Liu Date: Mon, 5 Mar 2018 07:46:43 +0000 (+0800) Subject: rgw: url_encode key name and instance in es sync module X-Git-Tag: v12.2.9~17^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24424%2Fhead;p=ceph.git rgw: url_encode key name and instance in es sync module Some objects whose name contains space or other special chars can't be synced to ES correctly. we need to do url_encode when we send a HTTP request to ES. Fixes: tracker.ceph.com/issues/23216 Signed-off-by: Chang Liu (cherry picked from commit 13978bb28b7be809033bf24550b21ed2713ddc9b) --- diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 025ce4bcba644..775fcd24e2d36 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -149,7 +149,7 @@ struct ElasticConfig { } string get_obj_path(const RGWBucketInfo& bucket_info, const rgw_obj_key& key) { - return index_path + "/object/" + bucket_info.bucket.bucket_id + ":" + key.name + ":" + (key.instance.empty() ? "null" : key.instance); + return index_path + "/object/" + url_encode(bucket_info.bucket.bucket_id + ":" + key.name + ":" + (key.instance.empty() ? "null" : key.instance)); } bool should_handle_operation(RGWBucketInfo& bucket_info) {