From ad51bf53f31e5e2d254838852da079e57ef815f9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 26 Feb 2017 04:21:24 -0800 Subject: [PATCH] rpc: better bitcoind compat. --- lib/http/server.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/http/server.js b/lib/http/server.js index 889cc872..6b3db540 100644 --- a/lib/http/server.js +++ b/lib/http/server.js @@ -614,12 +614,13 @@ HTTPServer.prototype._init = function _init() { }); } - if (!array) { - res.send(200, JSON.stringify(out[0]), 'json'); - return; - } + if (!array) + out = out[0]; - res.send(200, out); + out = JSON.stringify(out); + out += '\n'; + + res.send(200, out, 'json'); })); this.get('/', co(function* (req, res) {