From c6a1c8e8c4d42e7a5519c730e49962d4b597875b Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 25 Sep 2018 08:40:29 +0100 Subject: [PATCH] Fix corruption of websocket _session --- packages/node_modules/@node-red/nodes/core/io/22-websocket.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/io/22-websocket.js b/packages/node_modules/@node-red/nodes/core/io/22-websocket.js index 55964062d..26bd430b5 100644 --- a/packages/node_modules/@node-red/nodes/core/io/22-websocket.js +++ b/packages/node_modules/@node-red/nodes/core/io/22-websocket.js @@ -250,10 +250,10 @@ module.exports = function(RED) { this.on("input", function(msg) { var payload; if (this.serverConfig.wholemsg) { - var sess = ""+msg._session; + var sess = JSON.stringify(msg._session); delete msg._session; payload = JSON.stringify(msg); - msg._session = sess; + msg._session = JSON.parse(sess); } else if (msg.hasOwnProperty("payload")) { if (!Buffer.isBuffer(msg.payload)) { // if it's not a buffer make sure it's a string.