Allow batch RPC calls

This commit is contained in:
bitspill 2018-10-16 14:51:41 -07:00 committed by GitHub
parent d10de7fa72
commit f82d851dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,8 +329,8 @@ HTTPBase.prototype.parseBody = async function parseBody(req, options) {
switch (type) {
case 'json':
body = JSON.parse(data);
if (!body || typeof body !== 'object' || Array.isArray(body))
throw new Error('JSON body must be an object.');
if (!body || !(typeof body === 'object' || Array.isArray(body)))
throw new Error('JSON body must be an object or array.');
break;
case 'form':
body = parsePairs(data, options.keyLimit);