X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Frpc%2Fluasrc%2Fjsonrpc.lua;h=71c95d549b92d5c9025a6c3ab61df3d7b885aa85;hp=1c0db8bcefbb622254e755658f5591525de4fbdc;hb=bda994c32e8afda1cac2e0e4ae4c66c50d82c3f1;hpb=5778eae3693aff665eb0d1d384af31c1d1008386 diff --git a/modules/rpc/luasrc/jsonrpc.lua b/modules/rpc/luasrc/jsonrpc.lua index 1c0db8bce..71c95d549 100644 --- a/modules/rpc/luasrc/jsonrpc.lua +++ b/modules/rpc/luasrc/jsonrpc.lua @@ -44,9 +44,10 @@ function handle(tbl, rawsource, ...) if stat then if type(json.method) == "string" and (not json.params or type(json.params) == "table") then - if tbl[json.method] then + local method = resolve(tbl, json.method) + if method then response = reply(json.jsonrpc, json.id, - proxy(resolve(tbl, json.method), unpack(json.params or {}))) + proxy(method, unpack(json.params or {}))) else response = reply(json.jsonrpc, json.id, nil, {code=-32601, message="Method not found."}) @@ -90,4 +91,4 @@ function proxy(method, ...) return res end end -end \ No newline at end of file +end