Skip to content

feat(DEP0066): OutgoingMessage headers - #281

Merged
JakobJingleheimer merged 21 commits into
nodejs:mainfrom
elvessilvavieira:feat(outgoingmessage-headers)
Jan 25, 2026
Merged

JakobJingleheimer merged 21 commits into
nodejs:mainfrom
elvessilvavieira:feat(outgoingmessage-headers)

Conversation

@elvessilvavieira

@elvessilvavieira elvessilvavieira commented Nov 23, 2025 •

Copy link
Copy Markdown
Contributor

Hi, @AugustinMauroy

Here's a draft. I'd like to know if I'm on the right track. There are some things missing, like the README, but I'll add them. Thx

Resolves #128

@AugustinMauroy

Copy link
Copy Markdown
Member

No need to ping me, I receive notification for all thing on the repo

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too bad there are some pont that you can improve 👍

const matches = rootNode.findAll({
rule: { pattern: "$OBJ._headers[$KEY]" },
});
for (const m of matches) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const m of matches) {
for (const m of matches) {


{
const matches = rootNode.findAll({
rule: { pattern: "$OBJ._headers[$KEY]" },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main part here...

Here if the user code have ah propriety expression _headers it's will be catch. We need a more complex logic to catch http usage and -> catch response objects -> catch _headers

I have to admit that the orignal issue examples wasn't 100% complete

@AugustinMauroy

Copy link
Copy Markdown
Member

bump @elvessilvavieira 👋

@AugustinMauroy AugustinMauroy added the await:author Reviewer has requested something from the author label Dec 13, 2025
@elvessilvavieira
elvessilvavieira force-pushed the feat(outgoingmessage-headers) branch from 259f795 to 06a18ea Compare December 13, 2025 23:08
@elvessilvavieira

Copy link
Copy Markdown
Contributor Author

Hi, Augustin

I renamed the folder to http-outgoing message-headers then created a function looksLikeOutgoingMessage. pls tell me if it's weak in preventing false positives, or if there are any utilities that could help me. I even considered using resolveBindingPath for when they explicitly use http.createServer, but it has some drawbacks

@AugustinMauroy

Copy link
Copy Markdown
Member

Hi, Augustin

I renamed the folder to http-outgoing message-headers then created a function looksLikeOutgoingMessage. pls tell me if it's weak in preventing false positives, or if there are any utilities that could help me. I even considered using resolveBindingPath for when they explicitly use http.createServer, but it has some drawbacks

Yeah to have better handling of the detection/node catch workflow we can use https://docs.codemod.com/jssg/semantic-analysis which is a brand new feature of codemod

BTW codemod have a mcp that can help you it's aware of this new feature

@brunocroh
brunocroh marked this pull request as ready for review January 24, 2026 22:50
@brunocroh brunocroh added await:reviewer Author has responded and needs action from the reviewer and removed await:author Reviewer has requested something from the author labels Jan 24, 2026
@JakobJingleheimer JakobJingleheimer changed the title feat(outgoingmessage-headers) feat(DEP0066): OutgoingMessage headers Jan 25, 2026
@JakobJingleheimer JakobJingleheimer moved this to 🏗 In progress in Userland Migrations Board Jan 25, 2026
@JakobJingleheimer JakobJingleheimer added this to the 22.x → 24.x milestone Jan 25, 2026
@JakobJingleheimer JakobJingleheimer added await:author Reviewer has requested something from the author and removed await:reviewer Author has responded and needs action from the reviewer labels Jan 25, 2026
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
brunocroh and others added 5 commits January 25, 2026 13:14
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
@brunocroh brunocroh added await:reviewer Author has responded and needs action from the reviewer and removed await:author Reviewer has requested something from the author labels Jan 25, 2026

@JakobJingleheimer JakobJingleheimer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W00t! 🚀

@JakobJingleheimer JakobJingleheimer removed the await:reviewer Author has responded and needs action from the reviewer label Jan 25, 2026
schema_version: "1.0"
name: "@nodejs/http-outgoingmessage-headers"
version: 1.0.0
description: Handle DEP0066: migrate deprecated use of `OutgoingMessage.prototype` `_headers` & `_headerNames` to public HTTP header APIs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, whoops. My bad:

Error: 4:28 syntax error: mapping values are not allowed here (syntax)

https://github.com/nodejs/userland-migrations/actions/runs/21335657538/job/61408018425?pr=281#step:5:66

I think it doesn't like the :

Suggested change
description: Handle DEP0066: migrate deprecated use of `OutgoingMessage.prototype` `_headers` & `_headerNames` to public HTTP header APIs
description: Handle DEP0066 - migrate deprecated use of `OutgoingMessage.prototype` `_headers` & `_headerNames` to public HTTP header APIs

@JakobJingleheimer

JakobJingleheimer commented Jan 25, 2026 •

Copy link
Copy Markdown
Member

The lint is failing on test files. I think we should perhaps ignore test files for linting since we may need to explicitly handle syntax the linter disallows; if so, let's do that in a separate PR and merge it (via main) into this one to resolve those lint issues.

https://github.com/nodejs/userland-migrations/actions/runs/21335657538/job/61408018422?pr=281

@brunocroh

Copy link
Copy Markdown
Member

The lint is failing on test files. I think we should perhaps ignore test files for linting since we may need to explicitly handle syntax the linter disallows; if so, let's do that in a separate PR and merge it (via main) into this one to resolve those lint issues.

https://github.com/nodejs/userland-migrations/actions/runs/21335657538/job/61408018422?pr=281

Done here #355

@JakobJingleheimer JakobJingleheimer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@JakobJingleheimer JakobJingleheimer added the g2g No outstanding concerns, discussions, or issues. label Jan 25, 2026
@JakobJingleheimer
JakobJingleheimer merged commit 1fdb966 into nodejs:main Jan 25, 2026
18 checks passed
@brunocroh brunocroh mentioned this pull request Jan 26, 2026
14 of 18 tasks
@JakobJingleheimer JakobJingleheimer removed the g2g No outstanding concerns, discussions, or issues. label Mar 21, 2026
@AugustinMauroy AugustinMauroy moved this from 🏗 In progress to ✅ Done in Userland Migrations Board May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

feat: handle utgoingMessage.prototype._headers, OutgoingMessage.prototype._headerNames depreciation

4 participants