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 hanging promise on aborted requests on Node v14.3.0 #1296

Merged
merged 3 commits into from May 31, 2020
Merged

Fix hanging promise on aborted requests on Node v14.3.0 #1296

merged 3 commits into from May 31, 2020

Conversation

Giotino
Copy link
Collaborator

@Giotino Giotino commented May 29, 2020

Currently this is a solution that "works", but to me it doesn't seems right.

Fixes #1295

@szmarczak
Copy link
Collaborator

You need to remove this if

if (!this.destroyed) {
(but the content should be present). And just put if (this.destroyed) { return; } at the beginning of _beforeError.

@szmarczak
Copy link
Collaborator

^ just to prevent calling before error hooks if the error is not emitted.

@Giotino
Copy link
Collaborator Author

Giotino commented May 29, 2020

Like this?601fe10

@Giotino Giotino marked this pull request as ready for review May 31, 2020 10:54
@szmarczak szmarczak merged commit 2ccc4c2 into sindresorhus:master May 31, 2020
@szmarczak szmarczak changed the title Server side aborted request hang with node 14.3.0 Fix hanging promise on aborted requests on Node v14.3.0 May 31, 2020
@Giotino Giotino deleted the issue-1295 branch June 5, 2020 16:06
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.

Server side aborted request in stream mode hang with node 14.3.0
2 participants