]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: append query string to redirect URL if present 61160/head
authorSeena Fallah <seenafallah@gmail.com>
Fri, 6 Dec 2024 00:44:46 +0000 (01:44 +0100)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 20 Dec 2024 17:19:55 +0000 (12:19 -0500)
Ensure that a "?" is added to the redirect URL when query strings
are present.

Fixes: https://tracker.ceph.com/issues/69139
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 8de984d413d3b094fd49d9c2c7641d668d734156)

src/rgw/rgw_rest.cc

index fa62e19a51196ef6548a254fb942298bb5d08d82..a1e6adc385e66b3becc2a335b3af2898a69004c1 100644 (file)
@@ -645,8 +645,10 @@ static void build_redirect_url(req_state *s, const string& redirect_base, string
     dest_uri = dest_uri.substr(0, dest_uri.size() - 1);
   }
   dest_uri += s->info.request_uri;
-  dest_uri += "?";
-  dest_uri += s->info.request_params;
+  if (!s->info.request_params.empty()) {
+    dest_uri += "?";
+    dest_uri += s->info.request_params;
+  }
 }
 
 void abort_early(req_state *s, RGWOp* op, int err_no,