]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_rest: Make fallback uri configurable.
authorcaleb miles <caselim@gmail.com>
Mon, 14 Jan 2013 17:16:12 +0000 (12:16 -0500)
committercaleb miles <caselim@gmail.com>
Thu, 24 Jan 2013 20:30:58 +0000 (15:30 -0500)
Some HTTP servers, notabily lighttp, do not set SCRIPT_URI, make the fallback
string configurable.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/common/config_opts.h
src/rgw/rgw_rest.cc

index 0c79e29359154f31828770c7e242a16648209bde..e5ce1b20aaf819da6743f85fadda48a479ec758e 100644 (file)
@@ -455,6 +455,8 @@ OPTION(rgw_cache_enabled, OPT_BOOL, true)   // rgw cache enabled
 OPTION(rgw_cache_lru_size, OPT_INT, 10000)   // num of entries in rgw cache
 OPTION(rgw_socket_path, OPT_STR, "")   // path to unix domain socket, if not specified, rgw will not run as external fcgi
 OPTION(rgw_dns_name, OPT_STR, "")
+OPTION(rgw_script_uri, OPT_STR, "") // alternative value for SCRIPT_URI if not set in request
+OPTION(rgw_request_uri, OPT_STR,  "") // alternative value for REQUEST_URI if not set in request
 OPTION(rgw_swift_url, OPT_STR, "")             // the swift url, being published by the internal swift auth
 OPTION(rgw_swift_url_prefix, OPT_STR, "swift") // entry point for which a url is considered a swift url
 OPTION(rgw_swift_auth_url, OPT_STR, "")        // default URL to go and verify tokens for v1 auth (if not using internal swift auth)
index 2c80248286d7a95c5cba983cf4c87b84b68d857f..3b553f3b0c9c59040efb1dfc1238039db30a830e 100644 (file)
@@ -1120,8 +1120,8 @@ RGWRESTMgr::~RGWRESTMgr()
 int RGWREST::preprocess(struct req_state *s, RGWClientIO *cio)
 {
   s->cio = cio;
-  s->script_uri = s->env->get("SCRIPT_URI", "");
-  s->request_uri = s->env->get("REQUEST_URI");
+  s->script_uri = s->env->get("SCRIPT_URI", s->cct->_conf->rgw_script_uri.c_str());
+  s->request_uri = s->env->get("REQUEST_URI", s->cct->_conf->rgw_request_uri.c_str());
   int pos = s->request_uri.find('?');
   if (pos >= 0) {
     s->request_params = s->request_uri.substr(pos + 1);