1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Handle Buffer payloads in HTTP Response node

This commit is contained in:
Nick O'Leary 2015-05-02 22:20:46 +01:00
parent 51fce9343b
commit b3684a70b5

View File

@ -149,6 +149,8 @@ module.exports = function(RED) {
var len; var len;
if (msg.payload == null) { if (msg.payload == null) {
len = 0; len = 0;
} else if (Buffer.isBuffer(msg.payload)) {
len = msg.payload.length;
} else if (typeof msg.payload == "number") { } else if (typeof msg.payload == "number") {
len = Buffer.byteLength(""+msg.payload); len = Buffer.byteLength(""+msg.payload);
} else { } else {