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
1 changed files with 3 additions and 0 deletions

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 {