From 0bdb22c170b554c5f257d60d367a1293c61306d0 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 10 Oct 2021 12:05:01 +0200 Subject: [PATCH] gateway: HttpGateway: convertRequest(): Don't convert param to std::string --- gateway/httpgateway.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gateway/httpgateway.cpp b/gateway/httpgateway.cpp index 1953286..20dbca1 100644 --- a/gateway/httpgateway.cpp +++ b/gateway/httpgateway.cpp @@ -41,7 +41,7 @@ Request HttpGateway::convertRequest(httplib::Request request) // TODO: this eats resources, where perhaps it does not need to. move it to request? for(auto &it : request.params) { - it.second = utils::html_xss(std::string{it.second}); + it.second = utils::html_xss(it.second); } if(request.method == "GET") { @@ -83,7 +83,8 @@ void HttpGateway::work(RequestWorker &worker) { httplib::Server server; server.set_payload_max_length(this->maxPayloadLength); - auto handler = [&](const httplib::Request &req, httplib::Response &res) { + auto handler = [&](const httplib::Request &req, httplib::Response &res) + { Request wikiRequest = convertRequest(req); Logger::debug() << "httpgateway: received request " << wikiRequest; Response wikiresponse = worker.processRequest(wikiRequest);