restify / restify/node-restify

Usage of OutgoingMessage._headers is deprecated

Open
#1,856 0 comments 0 reactions 1 assignee View on GitHub

@mmarchini is already working on this.

Since Aug 25, 2020.

Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

https://github.com/restify/node-restify/blob/9153587c023a876237c1d8bc7491fee4984d9074/lib/response.js#L410

When 'trace'-level logging is enabled, access to self._headers causes a deprecation warning like this:

internal/process/warning.js:132
      throw warning;
      ^

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    at ServerResponse.__send (/server/node_modules/restify/lib/response.js:410:31)
    at ServerResponse.send (/server/node_modules/restify/lib/response.js:316:21)
    at emitError (/server/node_modules/restify/lib/server.js:1447:17)
    at onResult (/server/node_modules/restify/lib/server.js:1528:20)
    at next (/server/node_modules/vasync/lib/vasync.js:843:6)
    at emitErrDone (/server/node_modules/restify/lib/server.js:1521:28)
    ...
  name: 'DeprecationWarning',
  code: 'DEP0066'
}

Node.js version 12.16.1.

It is especially a headache if throw-on-deprecation is enabled, for example as mocha ... --throw-deprecation

Could this be fixed still for 8.x?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.