Allow batch RPC calls
This commit is contained in:
parent
cc8b496a96
commit
d10de7fa72
@ -437,8 +437,15 @@ HTTPBase.prototype.jsonRPC = function jsonRPC(rpc) {
|
|||||||
if (req.pathname !== '/')
|
if (req.pathname !== '/')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (typeof req.body.method !== 'string')
|
if (req.body instanceof Array) {
|
||||||
return;
|
for (const request of req.body) {
|
||||||
|
if (typeof request.method !== 'string')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (typeof req.body.method !== 'string')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let json = await rpc.call(req.body, req.query);
|
let json = await rpc.call(req.body, req.query);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user