mirror of
https://github.com/Syping/dtranslatebot.git
synced 2026-04-01 13:20:40 +02:00
http_request: fix http headers not being applied
This commit is contained in:
parent
60c91d0e4f
commit
58028b6e82
1 changed files with 2 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ const http_response http_request::get(const std::string &url, const dpp::http_he
|
|||
header_slist = new_header_slist;
|
||||
}
|
||||
}
|
||||
if (!header_slist)
|
||||
if (header_slist)
|
||||
curl_easy_setopt(instance, CURLOPT_HTTPHEADER, header_slist);
|
||||
curl_easy_setopt(instance, CURLOPT_WRITEDATA, &response.content);
|
||||
curl_easy_setopt(instance, CURLOPT_WRITEFUNCTION, &writer);
|
||||
|
|
@ -72,7 +72,7 @@ const http_response http_request::post(const std::string &url, const std::string
|
|||
header_slist = new_header_slist;
|
||||
}
|
||||
}
|
||||
if (!header_slist)
|
||||
if (header_slist)
|
||||
curl_easy_setopt(instance, CURLOPT_HTTPHEADER, header_slist);
|
||||
curl_easy_setopt(instance, CURLOPT_POSTFIELDS, content.data());
|
||||
curl_easy_setopt(instance, CURLOPT_POSTFIELDSIZE, content.size());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue