Skip to content

Deprecation warning in Node.js 12 #1073

Closed
@watson

Description

@watson

We need access to the host of an outgoing HTTP request and the easiest way to get this is from the Host header on the request object (req._headers.host).

Since the release of Node.js 12, the _headers property has been marked as deprecated (though it still works fine).

This results in Node.js printing:

(node:8970) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

The deprecation happened in nodejs/node#24167 and as far as I can see, there's currently no workaround. I propose that we make a PR to Node.js to add a public way to retrieve the host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-nodejsMake available for APM Agents project planning.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions