Fix bug of request header forwarding (#709)

* Fix bug of request header forwarding

* Replace insert(make_pair()) with emplace()

---------

Co-authored-by: Tindy X <49061470+tindy2013@users.noreply.github.com>
This commit is contained in:
aylz10 2024-04-02 18:34:33 +08:00 committed by GitHub
parent eef5328506
commit be2de49360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,7 @@ static httplib::Server::Handler makeHandler(const responseRoute &rr)
{
continue;
}
req.headers[h.first] = h.second;
req.headers.emplace(h.first.data(), h.second.data());
}
req.argument = request.params;
if (request.get_header_value("Content-Type") == "application/x-www-form-urlencoded")