From a9e7512936df0a946e30d2ab7944c35dda39866a Mon Sep 17 00:00:00 2001 From: yoshi314 Date: Thu, 13 Jan 2022 18:34:04 +0100 Subject: [PATCH] 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 --- userspace/falco/outputs_http.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/falco/outputs_http.cpp b/userspace/falco/outputs_http.cpp index afdc76ab..60667fd4 100644 --- a/userspace/falco/outputs_http.cpp +++ b/userspace/falco/outputs_http.cpp @@ -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);