diff --git a/server/control_session_http.cpp b/server/control_session_http.cpp index fac3e583..e5318e02 100644 --- a/server/control_session_http.cpp +++ b/server/control_session_http.cpp @@ -220,15 +220,16 @@ void ControlSessionHttp::handle_request(http::requestonMessageReceived(shared_from_this(), req.body(), [req = std::move(req), send = std::move(send)](const std::string& response) { - http::response res{http::status::ok, req.version()}; - res.set(http::field::server, HTTP_SERVER_NAME); - res.set(http::field::content_type, "application/json"); - res.keep_alive(req.keep_alive()); - res.body() = response; - res.prepare_payload(); - return send(std::move(res)); - }); + 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 res{http::status::ok, req.version()}; + res.set(http::field::server, HTTP_SERVER_NAME); + res.set(http::field::content_type, "application/json"); + res.keep_alive(req.keep_alive()); + res.body() = response; + res.prepare_payload(); + return send(std::move(res)); + }); } // Request path must be absolute and not contain "..".