From c247ce06e87a25c00cc9733f5c48d680e3345e39 Mon Sep 17 00:00:00 2001 From: Roman Khmelichek Date: Mon, 30 Oct 2017 17:10:56 -0400 Subject: [PATCH] Fix incorrect encoding of binary data. --- lib/frame.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/frame.js b/lib/frame.js index 65f0fd5..dea5b5f 100644 --- a/lib/frame.js +++ b/lib/frame.js @@ -29,12 +29,11 @@ StompFrame.prototype.send = function(stream) { } } frame += '\n'; + stream.write(frame); if (this.body.length > 0) { - frame += this.body; + stream.write(this.body); } - frame += '\0'; - if(frame) - stream.write(frame); + stream.write('\0'); }; StompFrame.prototype.setCommand = function(command) {