]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: iam: add all http args to req_info 31124/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 24 Oct 2019 14:19:01 +0000 (16:19 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 24 Oct 2019 14:19:01 +0000 (16:19 +0200)
parsing a iam post request arguments were broken after
a14353496d1f75a303495f538141a1a54ff28c60 as all the key values weren't in http
args anymore. Since the if conditional were specifically to url_decode POST args
which are by default url encoded anyway, just add all the key value pairs to the
req_info args as these are used later by the respective process requests

Fixes: https://tracker.ceph.com/issues/42470
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_rest_iam.cc

index b884d05b74d835ede4151b19fe9eec52850cbe5b..554f10e8b3394973bf1ee21b9cfa4976f255f6ea 100644 (file)
@@ -26,13 +26,8 @@ void RGWHandler_REST_IAM::rgw_iam_parse_input()
       for (const auto& t : tokens) {
         auto pos = t.find("=");
         if (pos != string::npos) {
-          const auto key = t.substr(0, pos);
-          if (key == "Action") {
-            s->info.args.append(key, t.substr(pos + 1, t.size() - 1));
-          } else if (key == "AssumeRolePolicyDocument" || key == "Path" || key == "PolicyDocument") {
-            const auto value = url_decode(t.substr(pos + 1, t.size() - 1));
-            s->info.args.append(key, value);
-          }
+          s->info.args.append(t.substr(0,pos),
+                              url_decode(t.substr(pos+1, t.size() -1)));
         }
       }
     }