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

Merge pull request #2540 from vladimir-kazan/fix-deprecation-warning

Fix: Remove nodejs deprecation warning in 21-httpin node
This commit is contained in:
Nick O'Leary 2020-05-04 12:42:30 +01:00 committed by GitHub
commit 95418724fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);