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 !== '/')
|
||||
return;
|
||||
|
||||
if (typeof req.body.method !== 'string')
|
||||
return;
|
||||
if (req.body instanceof Array) {
|
||||
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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user