Skip to content

Commit

Permalink
Merge 5fc8fb9 into 2412990
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Mar 21, 2021
2 parents 2412990 + 5fc8fb9 commit 458c836
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions push/src/gateway.cc
Expand Up @@ -94,11 +94,10 @@ int Gateway::performHttpRequest(HttpMethod method, const std::string& uri,
curl_easy_setopt(curl, CURLOPT_URL, uri.c_str());

curl_slist* header_chunk = nullptr;
header_chunk = curl_slist_append(header_chunk, CONTENT_TYPE);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_chunk);

if (!body.empty()) {
header_chunk = curl_slist_append(header_chunk, CONTENT_TYPE);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_chunk);

curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, body.size());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.data());
}
Expand All @@ -110,8 +109,7 @@ int Gateway::performHttpRequest(HttpMethod method, const std::string& uri,

switch (method) {
case HttpMethod::Post:
curl_easy_setopt(curl, CURLOPT_HTTPGET, 0L);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0L);
curl_easy_setopt(curl, CURLOPT_POST, 1L);
break;

case HttpMethod::Put:
Expand Down

0 comments on commit 458c836

Please sign in to comment.