]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: pass authentication domain to civetweb
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 10 Jan 2017 12:07:36 +0000 (13:07 +0100)
committerAbhishek Lekshmanan <alekshmanan@suse.com>
Mon, 6 Feb 2017 21:01:39 +0000 (22:01 +0100)
This is needed to support absolute uris, as civetweb further cross
checks whether the request is made to the same domain or not, otherwise
civetweb ends up sending NULL response back to the client. Also set the
REQUEST_URI to the full request uri, since the old uri parameter is
deprecated.

Fixes: http://tracker.ceph.com/issues/17657
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb_frontend.cc

index 65283c61b1fb099053c94a67d51d39de51781e08..93a8a030ac007d660ad664118437688d7c8c0995 100644 (file)
@@ -111,7 +111,7 @@ void RGWCivetWeb::init_env(CephContext *cct)
   }
 
   env.set("REQUEST_METHOD", info->request_method);
-  env.set("REQUEST_URI", info->uri);
+  env.set("REQUEST_URI", info->request_uri); // get the full uri, we anyway handle abs uris later
   env.set("SCRIPT_URI", info->uri); /* FIXME */
   if (info->query_string) {
     env.set("QUERY_STRING", info->query_string);
index 977883dc74d273dc2ee59c6a64e10fc09c29e261..5b64e7ea62258320744647ed1727a954e711c1a1 100644 (file)
@@ -53,6 +53,7 @@ int RGWCivetWebFrontend::run()
   set_conf_default(conf_map, "enable_keep_alive", "yes");
   set_conf_default(conf_map, "validate_http_method", "no");
   set_conf_default(conf_map, "canonicalize_url_path", "no");
+  set_conf_default(conf_map, "enable_auth_domain_check", "no");
   conf->get_val("port", "80", &port_str);
   std::replace(port_str.begin(), port_str.end(), '+', ',');
   conf_map["listening_ports"] = port_str;