]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw : add check empty for sync url 40563/head
authorcao.leilc <cao.leilc@inspur.com>
Fri, 2 Apr 2021 03:55:54 +0000 (11:55 +0800)
committercao.leilc <cao.leilc@inspur.com>
Tue, 6 Apr 2021 00:59:18 +0000 (08:59 +0800)
Fixes: https://tracker.ceph.com/issues/50103
Signed-off-by: caolei <halei15848934852@163.com>
src/rgw/rgw_rest_client.cc

index a98ba3b60d824a4da9f60318bbfac1f63cd76502..938a0cb59702c6e96b1361b2d24ded7e2dd64d32 100644 (file)
@@ -813,7 +813,7 @@ int RGWRESTStreamRWRequest::do_send_prepare(RGWAccessKey *key, map<string, strin
                                          bufferlist *send_data)
 {
   string new_url = url;
-  if (new_url[new_url.size() - 1] != '/')
+  if (!new_url.empty() && new_url.back() != '/')
     new_url.append("/");
   
   string new_resource;