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

Set content-length in HTTP response node

Fixes #233
This commit is contained in:
Nick O'Leary 2014-06-07 23:18:25 +01:00
parent 749eaa2181
commit 72476cc8a7

View File

@ -123,6 +123,9 @@ module.exports = function(RED) {
if (typeof msg.payload == "object" && !Buffer.isBuffer(msg.payload)) {
msg.res.jsonp(statusCode,msg.payload);
} else {
if (msg.res.get('content-length') == null) {
msg.res.set('content-length', Buffer.byteLength(msg.payload));
}
msg.res.send(statusCode,msg.payload);
}
} else {