From 5512585cc5e60e1aca2da7eb67d32cfb20611bf6 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 10 Apr 2023 23:05:44 +0200 Subject: [PATCH] fix: Make sure docs question request is always properly formatted --- plugins/builtin/include/content/popups/popup_docs_question.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/include/content/popups/popup_docs_question.hpp b/plugins/builtin/include/content/popups/popup_docs_question.hpp index d41d321c2..3015556d8 100644 --- a/plugins/builtin/include/content/popups/popup_docs_question.hpp +++ b/plugins/builtin/include/content/popups/popup_docs_question.hpp @@ -81,7 +81,8 @@ namespace hex::plugin::builtin { auto request = HttpRequest("POST", hex::format("https://api.gitbook.com/v1/spaces/{}/search/ask", space)); - request.setBody(hex::format(R"({{ "query": "{}" }})", input)); + const nlohmann::json body = { { "query", input } }; + request.setBody(body.dump()); request.addHeader("Content-Type", "application/json"); auto response = request.execute().get();