]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix REQUEST_URI setting in the rgw_asio_client.cc 30540/head
authorJiaying Ren <renjiaying@cmss.chinamobile.com>
Mon, 23 Sep 2019 01:44:11 +0000 (09:44 +0800)
committerJiaying Ren <renjiaying@cmss.chinamobile.com>
Tue, 24 Sep 2019 07:24:58 +0000 (15:24 +0800)
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 <renjiaying@cmss.chinamobile.com>
src/rgw/rgw_asio_client.cc

index 9b3031fbc13acb872b9067cbfd3f062913d2fa8c..58f79164f8d105e002e23d162133cf1ab872741a 100644 (file)
@@ -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());