From: Yehuda Sadeh Date: Thu, 20 May 2021 00:12:48 +0000 (-0700) Subject: rgw: auth v4 client: don't convert '+' to space X-Git-Tag: v17.1.0~1769^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=878857997e41c910c5f8662e6def6d3d0357943c;p=ceph.git rgw: auth v4 client: don't convert '+' to space Fixes: https://tracker.ceph.com/issues/50920 The plus sign can be used to represent space after conversion, but this pre conversion string representation will be hex encoded as plus. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index 629d1b9825b4..8b0b697ec907 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -578,16 +578,8 @@ static void add_v4_canonical_params_from_map(const map& m, if (key.empty()) { continue; } - const string *pval = &(entry.second); - string _val; - if (pval->find_first_of('+') != std::string::npos) { - _val = *pval; - boost::replace_all(_val, "+", " "); - pval = &_val; - } - - (*result)[aws4_uri_recode(key, true)] = aws4_uri_recode(*pval, true); + (*result)[aws4_uri_recode(key, true)] = aws4_uri_recode(entry.second, true); } }