From: Seena Fallah Date: Fri, 6 Dec 2024 00:44:46 +0000 (+0100) Subject: rgw: append query string to redirect URL if present X-Git-Tag: v19.2.3~256^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13ad910798c7b4d5f9c76131eac7d7bf68db095e;p=ceph.git rgw: append query string to redirect URL if present 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 (cherry picked from commit 8de984d413d3b094fd49d9c2c7641d668d734156) --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 8213779d3f740..1588ccce96d26 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -666,8 +666,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,