Skip to content

Deprecation warning in Node.js 12 #1073

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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