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

Removes call to deprecated OutgoingMessage.prototype._headers #859

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

SergeAstapov
Copy link
Contributor

Method response.getHeaders() was introduced in Node.js v7.7
Node.js PR nodejs/node#11562

Property response._headers deprecated in Node.js v12.0
Node.js PR nodejs/node#24167

Deprecation documentation https://nodejs.org/docs/latest-v12.x/api/deprecations.html#deprecations_dep0066_outgoingmessage_prototype_headers_outgoingmessage_prototype_headernames

This fixes an issue I see in Node.js v14:

(node:40723) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    at new FastbootResponse (/Users/.../node_modules/fastboot/src/fastboot-response.js:7:49)
    at new FastBootInfo (/Users/.../node_modules/fastboot/src/fastboot-info.js:27:21)
    at EmberApp.visit (/Users/.../node_modules/fastboot/src/ember-app.js:330:24)
    at FastBoot.visit (/Users/.../node_modules/fastboot/src/index.js:79:22)
    at /Users/.../node_modules/fastboot-express-middleware/src/index.js:31:14
    at /Users/.../node_modules/ember-cli-fastboot/index.js:342:11
    at Layer.handle [as handle_request] (/Users/.../node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/.../node_modules/express/lib/router/index.js:317:13)
    at /Users/.../node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/.../node_modules/express/lib/router/index.js:335:12)
    at next (/Users/.../node_modules/express/lib/router/index.js:275:10)
    at /Users/.../node_modules/ember-cli/lib/tasks/server/middleware/broccoli-watcher/index.js:54:11
    at watcher.then.errorHandler.buildError (/Users/.../node_modules/broccoli-middleware/lib/watcher-middleware.js:35:7)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

@SergeAstapov SergeAstapov force-pushed the fix-deprecation branch 4 times, most recently from 881e35f to 66d57fc Compare October 6, 2021 16:35
packages/fastboot/src/fastboot-response.js Outdated Show resolved Hide resolved
packages/fastboot/src/fastboot-response.js Outdated Show resolved Hide resolved
@SergeAstapov
Copy link
Contributor Author

@rwjblue updated only two tests where we explicitly used response._headers as this is now deprecated API which will be removed from Node.js itself and I believe we should stop using ourselves (although support it for the time being).

@SergeAstapov SergeAstapov requested a review from rwjblue October 8, 2021 17:15
@rwjblue rwjblue added the bug label Oct 8, 2021
@rwjblue rwjblue merged commit 38e8b50 into ember-fastboot:master Oct 8, 2021
@SergeAstapov SergeAstapov deleted the fix-deprecation branch October 8, 2021 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants