From 3c42ec0a64a840d40caa00f019c7e76cc28e9b85 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 16 Dec 2024 18:44:51 -0600 Subject: [PATCH] Add default arguments for api_* endpoints to prevent segfaults --- src/launchpad.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/launchpad.h b/src/launchpad.h index 90eb0f0..b93588d 100644 --- a/src/launchpad.h +++ b/src/launchpad.h @@ -69,13 +69,13 @@ public: // API Methods std::optional get_archive(const std::string& distribution_name); - std::optional api_get(const std::string& endpoint, const std::map& params = {}) const; - std::optional api_post(const std::string& endpoint, + std::optional api_get(const std::string& endpoint = "", const std::map& params = {}) const; + std::optional api_post(const std::string& endpoint = "", const std::map& params, bool build_endpoint = true, const std::string& token_secret_override = ""); - std::optional api_patch(const std::string& endpoint, const nlohmann::json& data); - std::optional api_delete(const std::string& endpoint); + std::optional api_patch(const std::string& endpoint = "", const nlohmann::json& data); + std::optional api_delete(const std::string& endpoint = ""); std::string build_full_url(const std::string& endpoint) const;