fix setting the variable of User-Agent, it was missing the prefix. Switched to dedicated curl's method to do this

Signed-off-by: Marcin Kowalski <marcin.kowalski@assecobs.pl>
This commit is contained in:
yoshi314 2022-01-13 18:34:04 +01:00 committed by poiana
parent f67e8bdad7
commit a9e7512936

View File

@ -34,11 +34,11 @@ void falco::outputs::output_http::output(const message *msg)
} else {
slist1 = curl_slist_append(slist1, "Content-Type: text/plain");
}
slist1 = curl_slist_append(slist1, m_oc.options["user_agent"].c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist1);
curl_easy_setopt(curl, CURLOPT_URL, m_oc.options["url"].c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, msg->msg.c_str());
curl_easy_setopt(curl, CURLOPT_USERAGENT, m_oc.options["user_agent"].c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, -1L);