gateway: HttpGateway: convertRequest(): Don't convert param to std::string
This commit is contained in:
parent
eb49b013a7
commit
0bdb22c170
@ -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?
|
// TODO: this eats resources, where perhaps it does not need to. move it to request?
|
||||||
for(auto &it : request.params)
|
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")
|
if(request.method == "GET")
|
||||||
{
|
{
|
||||||
@ -83,7 +83,8 @@ void HttpGateway::work(RequestWorker &worker)
|
|||||||
{
|
{
|
||||||
httplib::Server server;
|
httplib::Server server;
|
||||||
server.set_payload_max_length(this->maxPayloadLength);
|
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);
|
Request wikiRequest = convertRequest(req);
|
||||||
Logger::debug() << "httpgateway: received request " << wikiRequest;
|
Logger::debug() << "httpgateway: received request " << wikiRequest;
|
||||||
Response wikiresponse = worker.processRequest(wikiRequest);
|
Response wikiresponse = worker.processRequest(wikiRequest);
|
||||||
|
Loading…
Reference in New Issue
Block a user