Fix handling of post requests

This commit is contained in:
badaix 2021-06-10 12:26:12 +02:00
parent 0807641984
commit 017ab24c0b

View file

@ -220,7 +220,8 @@ void ControlSessionHttp::handle_request(http::request<Body, http::basic_fields<A
if (req.target() != "/jsonrpc")
return send(bad_request("Illegal request-target"));
message_receiver_->onMessageReceived(shared_from_this(), req.body(), [req = std::move(req), send = std::move(send)](const std::string& response) {
return message_receiver_->onMessageReceived(shared_from_this(), std::string(req.body()),
[req = std::move(req), send = std::move(send)](const std::string& response) {
http::response<http::string_body> res{http::status::ok, req.version()};
res.set(http::field::server, HTTP_SERVER_NAME);
res.set(http::field::content_type, "application/json");