]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set default value for env->get() call 6042/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 25 Sep 2015 17:44:40 +0000 (10:44 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Mon, 28 Sep 2015 20:23:36 +0000 (13:23 -0700)
Fixes: #13239
This fixes a regression introduced at commit abe4ec293d08b0314bf5c081ace2456073f3a22c.
The host var is a string, env->get() returns a char pointer, shouldn't
pass in NULL.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 0d5730efc0054334897315dc23ba04f30548e36e)
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
src/rgw/rgw_common.cc

index 6f75561b971a3d1f194511e2336482c736b9788c..7da306fed792026b0a1dee1a75e2bad943b1d95e 100644 (file)
@@ -99,7 +99,7 @@ is_err() const
 
 
 req_info::req_info(CephContext *cct, class RGWEnv *e) : env(e) {
-  method = env->get("REQUEST_METHOD");
+  method = env->get("REQUEST_METHOD", "");
   script_uri = env->get("SCRIPT_URI", cct->_conf->rgw_script_uri.c_str());
   request_uri = env->get("REQUEST_URI", cct->_conf->rgw_request_uri.c_str());
   int pos = request_uri.find('?');
@@ -109,7 +109,7 @@ req_info::req_info(CephContext *cct, class RGWEnv *e) : env(e) {
   } else {
     request_params = env->get("QUERY_STRING", "");
   }
-  host = env->get("HTTP_HOST");
+  host = env->get("HTTP_HOST", "");
 
   // strip off any trailing :port from host (added by CrossFTP and maybe others)
   size_t colon_offset = host.find_last_of(':');