From ffe6ba39fa54cb5013f5896e7e221fc12339eb0f Mon Sep 17 00:00:00 2001 From: Jiaying Ren Date: Mon, 23 Sep 2019 09:44:11 +0800 Subject: [PATCH] rgw: fix REQUEST_URI setting in the rgw_asio_client.cc rebased https://github.com/ceph/ceph/pull/16935 to the master, the Civetweb part has been addressed,the Beast part is still missing. As Civetweb has set REQUEST_URI with full uri by: env.set("REQUEST_URI", info->request_uri); // get the full uri, we anyway handle abs uris later Beast frontend should match this too. Signed-off-by: Jiaying Ren --- src/rgw/rgw_asio_client.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rgw/rgw_asio_client.cc b/src/rgw/rgw_asio_client.cc index 9b3031fbc13a..58f79164f8d1 100644 --- a/src/rgw/rgw_asio_client.cc +++ b/src/rgw/rgw_asio_client.cc @@ -70,15 +70,16 @@ int ClientIO::init_env(CephContext *cct) env.set("REQUEST_METHOD", request.method_string().to_string()); // split uri from query - auto url = request.target(); - auto pos = url.find('?'); - if (pos != url.npos) { - auto query = url.substr(pos + 1); + auto uri = request.target(); + auto pos = uri.find('?'); + if (pos != uri.npos) { + auto query = uri.substr(pos + 1); env.set("QUERY_STRING", query.to_string()); - url = url.substr(0, pos); + uri = uri.substr(0, pos); } - env.set("REQUEST_URI", url.to_string()); - env.set("SCRIPT_URI", url.to_string()); /* FIXME */ + env.set("SCRIPT_URI", uri.to_string()); + + env.set("REQUEST_URI", request.target().to_string()); char port_buf[16]; snprintf(port_buf, sizeof(port_buf), "%d", local_endpoint.port()); -- 2.47.3