From 6232f9d59378fd757a22941c2828671db4b2614b Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Sun, 31 Mar 2024 11:53:47 +0200 Subject: [PATCH] Fix: clear reponse text before doing curl request Response text is appended to whatever is in _text, so that should be cleared before every request. --- src/requester.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/requester.cpp b/src/requester.cpp index 914d14e..33436b4 100644 --- a/src/requester.cpp +++ b/src/requester.cpp @@ -74,6 +74,7 @@ std::string requester::post(const std::string& url, const std::string& json) { curl_easy_setopt(_h.get(), CURLOPT_HTTPHEADER, headers); curl_easy_setopt(_h.get(), CURLOPT_WRITEDATA, this); + _text = ""; auto success = curl_easy_perform(_h.get()); if (success != CURLE_OK) { std::ostringstream oss;