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:
parent
51fce9343b
commit
b3684a70b5
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user