From: Yehuda Sadeh Date: Fri, 3 Feb 2012 17:32:14 +0000 (-0800) Subject: rgw: use request uri if script name is empty X-Git-Tag: v0.44~85 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13c89137e76cd95ca3a7b3a48d4875c7ae59c6aa;p=ceph.git rgw: use request uri if script name is empty this was required for some nginx configuration Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index cf888ebe735c..7574b71038e7 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -516,7 +516,7 @@ struct req_state { bool content_started; int format; ceph::Formatter *formatter; - const char *path_name; + string path_name; string path_name_url; string request_uri; const char *host; diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index ab8561d06106..29d9f104868c 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -445,7 +445,7 @@ static int init_entities_from_header(struct req_state *s) } else s->host_bucket = NULL; - const char *req_name = s->path_name; + const char *req_name = s->path_name.c_str(); const char *p; if (*req_name == '?') { @@ -771,6 +771,8 @@ int RGWHandler_REST::preprocess(struct req_state *s, FCGX_Request *fcgx) s->request_uri = s->request_uri.substr(0, pos); } url_decode(s->request_uri, s->path_name_url); + if (s->path_name.empty()) + s->path_name = s->path_name_url.c_str(); s->method = s->env->get("REQUEST_METHOD"); s->host = s->env->get("HTTP_HOST"); s->query = s->env->get("QUERY_STRING");