Permalink
Browse files

Fix bug in jsonstream when stream is empty

  • Loading branch information...
1 parent 5c72dd6 commit 1686918da2fb04228da1c7476c346739ea66decd @creationix creationix committed May 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 http-adapter/restful.js
@@ -25,7 +25,8 @@ module.exports = function setup(mount, vfs) {
}
});
input.on("end", function () {
- output.emit("data", "\n]");
+ if (first) output.emit("data", "[]");
+ else output.emit("data", "\n]");
output.emit("end");
});
if (input.pause) {

0 comments on commit 1686918

Please sign in to comment.