Skip to content

Commit

Permalink
rgw: fix use of libcurl with empty header values
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/23663

Signed-off-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Apr 11, 2018
1 parent 997aced commit f8df376
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rgw/rgw_http_client.cc
Expand Up @@ -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());
}

Expand Down

0 comments on commit f8df376

Please sign in to comment.