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 c2fab34e3..55964062d 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,9 +250,12 @@ module.exports = function(RED) { this.on("input", function(msg) { var payload; if (this.serverConfig.wholemsg) { + var sess = ""+msg._session; delete msg._session; payload = JSON.stringify(msg); - } else if (msg.hasOwnProperty("payload")) { + msg._session = sess; + } + else if (msg.hasOwnProperty("payload")) { if (!Buffer.isBuffer(msg.payload)) { // if it's not a buffer make sure it's a string. payload = RED.util.ensureString(msg.payload); }