]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use request uri if script name is empty
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 3 Feb 2012 17:32:14 +0000 (09:32 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 3 Feb 2012 17:34:10 +0000 (09:34 -0800)
this was required for some nginx configuration

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
src/rgw/rgw_common.h
src/rgw/rgw_rest.cc

index cf888ebe735cfe9b7712db84c9ccb54c9d39751f..7574b71038e769482b987719447f5f40c1b3393d 100644 (file)
@@ -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;
index ab8561d06106c95933d8c69543103cd8c01907a4..29d9f104868cea41f337ed670451de116ba9c8a0 100644 (file)
@@ -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");