From 58028b6e82372bd07ab10b6621c4f487ba592c3c Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 29 Mar 2026 03:34:18 +0200 Subject: [PATCH] http_request: fix http headers not being applied --- src/core/http_request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/http_request.cpp b/src/core/http_request.cpp index 58d9e0e..d9f6498 100644 --- a/src/core/http_request.cpp +++ b/src/core/http_request.cpp @@ -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());