From: Jiaying Ren Date: Mon, 23 Sep 2019 01:44:11 +0000 (+0800) Subject: rgw: fix REQUEST_URI setting in the rgw_asio_client.cc X-Git-Tag: v15.1.0~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffe6ba39fa54cb5013f5896e7e221fc12339eb0f;p=ceph.git 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 --- 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());