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 res.end patch to always commit headers #767

Merged
merged 1 commit into from Jul 9, 2020
Merged

Conversation

dougwilson
Copy link
Contributor

This adds a missing command to commit the progressive headers within res.end before attempting to read them. This has the standard side-effect of ensuring a second call to res.end will fail with a headers already set error. This is the same behavior other modules like compression does to get the headers set, same as the internal Node.js code of res.end.

Fixes #766

@josh-byster
Copy link

After dropping this in-place and rerunning my existing code that caused me to discover this, it seems to be working exactly as I would expect! Thank you very much for this prompt fix!

@dougwilson
Copy link
Contributor Author

No problem at all, thanks for reporting!

@dougwilson dougwilson merged commit 6a128cc into master Jul 9, 2020
@dougwilson dougwilson deleted the fix/multi-end branch July 9, 2020 12:52
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.

Sending after request end doesn't throw error, hangs response instead
2 participants