From: Gabriel Adrian Samfira Date: Thu, 2 Nov 2023 22:41:09 +0000 (+0200) Subject: Do not encode slashes X-Git-Tag: v18.2.5~474^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6207d562e95035e92e357e4b116096f0206f1a2;p=ceph.git Do not encode slashes Encoding the slash in object names breaks when the object we're trying to fetch is inside a folder. A side effect of this is that the cloud sync module fails to sync folders and objects nested within. Signed-off-by: Gabriel Adrian Samfira (cherry picked from commit 6b2e616b9321774ac2ccc54ab19233894b9793c5) --- diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index b0b8fcc84f30..153f637c67bf 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -803,7 +803,8 @@ static void send_prepare_convert(const rgw_obj& obj, string *resource) { string urlsafe_bucket, urlsafe_object; url_encode(obj.bucket.get_key(':', 0), urlsafe_bucket); - url_encode(obj.key.name, urlsafe_object); + // do not encode slash. It leads to 404 errors when fetching objects inside folders. + url_encode(obj.key.name, urlsafe_object, false); *resource = urlsafe_bucket + "/" + urlsafe_object; }