summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-03-20 16:29:16 +0100
committertastytea2020-03-20 16:29:16 +0100
commitb5144fd9ceeabe090f33396a3ae7f6550d1dafa4 (patch)
treee4d3a107a1926f5d4a03f7fdcfa16a62cc0af260
parent0bbc6ac4c78df096b40350cf33f88b11231b343c (diff)
downloadmastodonpp-b5144fd9ceeabe090f33396a3ae7f6550d1dafa4.tar
mastodonpp-b5144fd9ceeabe090f33396a3ae7f6550d1dafa4.tar.gz
mastodonpp-b5144fd9ceeabe090f33396a3ae7f6550d1dafa4.zip
Ensure that the first parameter in all GET calls is prefaced with ?.
All calls to CURLWrapper::add_parameters_to_uri() but the first used & for all parameters, because the boolean keeping track was implemented wrong.
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/curl_wrapper.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f69652b..6adb0bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.")
option(BUILD_SHARED_LIBS "Build shared libraries." YES)
project(mastodonpp
- VERSION 0.5.2
+ VERSION 0.5.3
DESCRIPTION "C++ wrapper for the Mastodon and Pleroma APIs."
LANGUAGES CXX)
diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp
index 0d78e6d..28292d9 100644
--- a/src/curl_wrapper.cpp
+++ b/src/curl_wrapper.cpp
@@ -405,6 +405,7 @@ bool CURLWrapper::replace_parameter_in_uri(string &uri,
void CURLWrapper::add_parameters_to_uri(string &uri,
const parametermap &parameters)
{
+ bool first{true};
// Replace <ID> with the value of parameter “id” and so on.
for (const auto &param : parameters)
{
@@ -413,7 +414,6 @@ void CURLWrapper::add_parameters_to_uri(string &uri,
continue;
}
- static bool first{true};
if (first)
{
uri += "?";