X Tutup
The Wayback Machine - https://web.archive.org/web/20210116143904/https://github.com/restify/node-restify/issues/1856
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of OutgoingMessage._headers is deprecated #1856

Open
sergburn opened this issue Aug 25, 2020 · 0 comments
Open

Usage of OutgoingMessage._headers is deprecated #1856

sergburn opened this issue Aug 25, 2020 · 0 comments
Assignees

Comments

@sergburn
Copy link

@sergburn sergburn commented Aug 25, 2020

headers: self._headers

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?

@mmarchini mmarchini self-assigned this Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup