]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/rest: fix url decode of post params for iam/sts/sns
authorCasey Bodley <cbodley@redhat.com>
Fri, 26 Jan 2024 14:53:30 +0000 (09:53 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 29 Jan 2024 16:35:33 +0000 (11:35 -0500)
add the `in_query=true` argument to `url_decode()` to replace '+' with ' '

Fixes: https://tracker.ceph.com/issues/64189
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 4bdc5d18dd68b95c6ccd4c0e77a1bd04ad86dbb8)

Conflicts:
src/rgw/rgw_rest_pubsub.cc no topic policy or SetTopicAttributes

src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_user_policy.cc

index 8c9f535afc25fee14229b3e81be35921a35010fe..7b27af8634aaa15c0ca771a021a90943a28b693c 100644 (file)
@@ -5192,8 +5192,9 @@ void parse_post_action(const std::string& post_body, req_state* s)
           if (boost::starts_with(key, "Attributes.")) {
             update_attribute_map(t, map);
           } else {
+            constexpr bool in_query = true; // replace '+' with ' '
             s->info.args.append(t.substr(0, pos),
-                              url_decode(t.substr(pos+1, t.size() -1)));
+                              url_decode(t.substr(pos+1, t.size() -1), in_query));
           }
         }
       }
index 2e300468b95cdb3e937e908fd49eface6d7c2287..2995a43adbf4ec2292d248b11989ef897df6917c 100644 (file)
@@ -91,9 +91,9 @@ uint64_t RGWPutUserPolicy::get_op()
 
 int RGWPutUserPolicy::get_params()
 {
-  policy_name = url_decode(s->info.args.get("PolicyName"), true);
-  user_name = url_decode(s->info.args.get("UserName"), true);
-  policy = url_decode(s->info.args.get("PolicyDocument"), true);
+  policy_name = s->info.args.get("PolicyName");
+  user_name = s->info.args.get("UserName");
+  policy = s->info.args.get("PolicyDocument");
 
   if (policy_name.empty() || user_name.empty() || policy.empty()) {
     ldpp_dout(this, 20) << "ERROR: one of policy name, user name or policy document is empty"