From 64275d516bcc570d1a9b9fea644bcab34483db35 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Tue, 27 Mar 2018 16:19:47 +0200 Subject: [PATCH] rgw: update civetweb to 1.1 Introduces the following additions in rgw: - allow_unicode_in_urls introduced with a corresponding downstream commit in civetweb, as the newer version of civetweb validates that urls are url encoded which swifttests do not follow, so introduce this as a configurable which we set as true - mg header struct changes in civetweb update, use auto here - drop info->uri and use local_uri instead as the former is deprecated wip: rgw: civetweb fixes for v1.1 upgrade Signed-off-by: Abhishek Lekshmanan --- src/civetweb | 2 +- src/rgw/rgw_civetweb.cc | 4 ++-- src/rgw/rgw_civetweb_frontend.cc | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/civetweb b/src/civetweb index bdaa39a1ebb..1433012e72f 160000 --- a/src/civetweb +++ b/src/civetweb @@ -1 +1 @@ -Subproject commit bdaa39a1ebb01ae38edee9e97a3d46972cb68ac9 +Subproject commit 1433012e72f2b7f8d06750a29310725cd4368f99 diff --git a/src/rgw/rgw_civetweb.cc b/src/rgw/rgw_civetweb.cc index c28fac47652..2da2912ed50 100644 --- a/src/rgw/rgw_civetweb.cc +++ b/src/rgw/rgw_civetweb.cc @@ -92,7 +92,7 @@ int RGWCivetWeb::init_env(CephContext *cct) } for (int i = 0; i < info->num_headers; i++) { - const struct mg_request_info::mg_header* header = &info->http_headers[i]; + const auto header = &info->http_headers[i]; if (header->name == nullptr || header->value==nullptr) { lderr(cct) << "client supplied malformatted headers" << dendl; @@ -138,7 +138,7 @@ int RGWCivetWeb::init_env(CephContext *cct) env.set("REQUEST_METHOD", info->request_method); env.set("HTTP_VERSION", info->http_version); env.set("REQUEST_URI", info->request_uri); // get the full uri, we anyway handle abs uris later - env.set("SCRIPT_URI", info->uri); /* FIXME */ + env.set("SCRIPT_URI", info->local_uri); if (info->query_string) { env.set("QUERY_STRING", info->query_string); } diff --git a/src/rgw/rgw_civetweb_frontend.cc b/src/rgw/rgw_civetweb_frontend.cc index 33e00144647..7d7325d9439 100644 --- a/src/rgw/rgw_civetweb_frontend.cc +++ b/src/rgw/rgw_civetweb_frontend.cc @@ -58,6 +58,7 @@ int RGWCivetWebFrontend::run() 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"); + set_conf_default(conf_map, "allow_unicode_in_urls", "yes"); std::string listening_ports; // support multiple port= entries -- 2.39.5