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

Fix: Remove nodejs deprecation warning in 21-httpin node

This commit is contained in:
Vladimir Kuznetsov 2020-04-15 15:38:22 +02:00
parent bc96f2d0cb
commit 33200b2d08

View File

@ -228,7 +228,7 @@ module.exports = function(RED) {
var diff = process.hrtime(startAt);
var ms = diff[0] * 1e3 + diff[1] * 1e-6;
var metricResponseTime = ms.toFixed(3);
var metricContentLength = res._headers["content-length"];
var metricContentLength = res.getHeader("content-length");
//assuming that _id has been set for res._metrics in HttpOut node!
node.metric("response.time.millis", {_msgid:res._msgid} , metricResponseTime);
node.metric("response.content-length.bytes", {_msgid:res._msgid} , metricContentLength);