From 3ca99ddd52c78286294270944b7251324bf64792 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 17 Aug 2022 16:56:33 +0200 Subject: [PATCH] Fix JSON-RPC response, should be in "result" and not in "response". This breaks all the current script(s) that depend on it, of course, but makes us correctly conform to the JSON-RPC specification. Reported by Valware. --- src/modules/rpc/rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/rpc/rpc.c b/src/modules/rpc/rpc.c index 8fb8872df..047e840bb 100644 --- a/src/modules/rpc/rpc.c +++ b/src/modules/rpc/rpc.c @@ -494,7 +494,7 @@ void _rpc_response(Client *client, json_t *request, json_t *result) json_object_set_new(j, "method", json_string_unreal(method)); if (id) json_object_set_new(j, "id", id); /* 'id' is optional */ - json_object_set(j, "response", result); + json_object_set(j, "result", result); json_serialized = json_dumps(j, 0); if (!json_serialized)