From: Casey Bodley Date: Wed, 11 Apr 2018 20:54:03 +0000 (-0400) Subject: rgw: fix use of libcurl with empty header values X-Git-Tag: v12.2.6~52^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=12c8ee5ba53d7e11fdefbc183d048474b9e3358f;p=ceph.git rgw: fix use of libcurl with empty header values Fixes: http://tracker.ceph.com/issues/23663 Signed-off-by: Casey Bodley (cherry picked from commit f8df37615dda5d178666f30a055d7ff4fcdb9623) --- diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 72c8a14f1db..61146748d63 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -350,8 +350,13 @@ static curl_slist *headers_to_slist(param_vec_t& headers) } } - val.append(": "); - val.append(p.second); + // curl won't send headers with empty values unless it ends with a ; instead + if (p.second.empty()) { + val.append(1, ';'); + } else { + val.append(": "); + val.append(p.second); + } h = curl_slist_append(h, val.c_str()); }