From dd211a012b8eb410f0a29dc7992f90312fbc6ff2 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Mon, 5 Mar 2018 15:46:43 +0800 Subject: [PATCH] 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) --- src/rgw/rgw_sync_module_es.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.39.5