]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix use of libcurl with empty header values
authorCasey Bodley <cbodley@redhat.com>
Wed, 11 Apr 2018 20:54:03 +0000 (16:54 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 11 Apr 2018 21:46:16 +0000 (17:46 -0400)
Fixes: http://tracker.ceph.com/issues/23663
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_http_client.cc

index f96b7d5c51cfcc8057144b04fff0ddb635394fec..4e2ae49094ad15a03a796d23a8a500c44f4bd2ae 100644 (file)
@@ -352,8 +352,13 @@ static curl_slist *headers_to_slist(param_vec_t& headers)
     
     val = camelcase_dash_http_attr(val);
 
-    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());
   }