From 0d5730efc0054334897315dc23ba04f30548e36e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 25 Sep 2015 10:44:40 -0700 Subject: [PATCH] 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 --- src/rgw/rgw_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 132fd9e809f88..d1e297139d77f 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(':');