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

fix(ext/node): add ServerResponse#appendHeader #24216

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Jun 15, 2024

Fixes #19993
Closes #16679

Copy link
Member

@satyarohith satyarohith left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

This method is already defined in OutgoingMessage class in _http_outgoing.ts. I don't think we should add another one, but instead we should rewrite ServerResponse to use ES5 classes and "mixin" both OutgoingMessage and NodeWritable

@lucacasonato
Copy link
Member

@bartlomieju Their header handling is different unfortunately.

@bartlomieju
Copy link
Member

@lucacasonato how so? If you look at ServerResponse class in Node.js: https://github.com/nodejs/node/blob/f2381bc7cb120e43bb97ffeccd19dfdc946c8b2c/lib/_http_server.js#L195-L230 you can see that it uses OutgoingMessage mixin to provide appendHeader method. Maybe our implementation got out of sync with what Node is doing?

@bartlomieju
Copy link
Member

Discussed offline, it's fine to land as is, I'm gonna rewrite this module after #24237 lands.

Please address Luca's comments before landing.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM!

@littledivy littledivy merged commit 416df1e into denoland:main Jun 21, 2024
17 checks passed
@littledivy littledivy deleted the node_serverResponse_appendHeader branch June 21, 2024 13:52
@littledivy littledivy restored the node_serverResponse_appendHeader branch June 21, 2024 13:52
@littledivy littledivy deleted the node_serverResponse_appendHeader branch June 21, 2024 14:00
sbmsr pushed a commit to sbmsr/deno-1 that referenced this pull request Jul 2, 2024
zebreus pushed a commit to zebreus/deno that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ServerResponse#appendHeader not implemented Support Next.JS
5 participants