diff --git a/src/rpc/RPC.cpp b/src/rpc/RPC.cpp index 8ea88905..006f60fd 100644 --- a/src/rpc/RPC.cpp +++ b/src/rpc/RPC.cpp @@ -37,7 +37,7 @@ make_HttpContext( if (command == "subscribe" || command == "unsubscribe") return {}; - if (!request.contains("params") || !request.at("params").is_array()) + if (!request.at("params").is_array()) return {}; boost::json::array const& array = request.at("params").as_array(); diff --git a/src/webserver/HttpBase.h b/src/webserver/HttpBase.h index 98d68cd2..152b4bc0 100644 --- a/src/webserver/HttpBase.h +++ b/src/webserver/HttpBase.h @@ -111,6 +111,9 @@ handle_request( try { request = boost::json::parse(req.body()).as_object(); + + if (!request.contains("params")) + request["params"] = boost::json::array({ boost::json::object {} }); } catch (std::runtime_error const& e) {