From: Yehuda Sadeh Date: Fri, 25 Sep 2015 17:44:40 +0000 (-0700) Subject: rgw: set default value for env->get() call X-Git-Tag: v9.1.0~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6110%2Fhead;p=ceph.git rgw: set default value for env->get() call 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 --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 132fd9e809f8..d1e297139d77 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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(':');