Skip to content

fix: flush headers before sending data via readable stream #245

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

usualoma
Copy link
Member

@usualoma usualoma commented Jun 6, 2025

fixes: #244

Even if data is not immediately written from a ReadableStream, the header is sent without waiting for the data.

Is it sufficient to only handle ServerResponse?

Yes, in the case of Http2ServerResponse, there is no need to explicitly flush because the header is sent without waiting for the data.

Is this related to change #242?

No, it is not related. node-server has always behaved this way.

@usualoma
Copy link
Member Author

usualoma commented Jun 6, 2025

Hi @yusukebe!
Would you please review this?

@yusukebe
Copy link
Member

yusukebe commented Jun 6, 2025

Hey @usualoma !

Great! I've confirmed that it works correctly. Thank you!

@yusukebe yusukebe merged commit 69d274d into honojs:main Jun 6, 2025
3 checks passed
@yusukebe yusukebe changed the title feat: flush headers before sending data via readable stream fix: flush headers before sending data via readable stream Jun 6, 2025
@usualoma usualoma deleted the flush-headers-readable-stream branch June 7, 2025 05:12
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.

node-server doesn't flush headers until content is written to it
2 participants