json-rpc-test-server: reject non-null params in "ping"

This commit is contained in:
Přemysl Eric Janouch 2020-09-01 20:56:03 +02:00
parent 20558ecd2b
commit ee5317f865
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 1 deletions

View File

@ -1449,7 +1449,10 @@ static json_t *
json_rpc_ping (struct server_context *ctx, json_t *params)
{
(void) ctx;
(void) params;
if (params && !json_is_null (params))
return json_rpc_response (NULL, NULL,
json_rpc_error (JSON_RPC_ERROR_INVALID_PARAMS, NULL));
return json_rpc_response (NULL, json_string ("pong"), NULL);
}