mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
json-rpc: Remove double-quoting on errors in JSON-RPC
The use of `json_tok_full_len` and `json_tok_full` in addition to single quotes will result in double quoting, which is really weird. I opted to single quoting using `'` instead which does not need to be escaped. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
c029f2fb0f
commit
5d05694920
@@ -353,8 +353,8 @@ static struct command_result *json_help(struct command *cmd,
|
||||
}
|
||||
return command_fail(cmd, JSONRPC2_METHOD_NOT_FOUND,
|
||||
"Unknown command '%.*s'",
|
||||
json_tok_full_len(cmdtok),
|
||||
json_tok_full(buffer, cmdtok));
|
||||
cmdtok->end - cmdtok->start,
|
||||
buffer + cmdtok->start);
|
||||
}
|
||||
|
||||
response = json_stream_success(cmd);
|
||||
@@ -586,10 +586,9 @@ parse_request(struct json_connection *jcon, const jsmntok_t tok[])
|
||||
|
||||
c->json_cmd = find_cmd(jcon->ld->jsonrpc, jcon->buffer, method);
|
||||
if (!c->json_cmd) {
|
||||
return command_fail(c, JSONRPC2_METHOD_NOT_FOUND,
|
||||
"Unknown command '%.*s'",
|
||||
json_tok_full_len(method),
|
||||
json_tok_full(jcon->buffer, method));
|
||||
return command_fail(
|
||||
c, JSONRPC2_METHOD_NOT_FOUND, "Unknown command '%.*s'",
|
||||
method->end - method->start, jcon->buffer + method->start);
|
||||
}
|
||||
if (c->json_cmd->deprecated && !deprecated_apis) {
|
||||
return command_fail(c, JSONRPC2_METHOD_NOT_FOUND,
|
||||
|
||||
Reference in New Issue
Block a user