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

http.ClientRequest response object only emits close after abort? #17352

Closed
ronag opened this issue Nov 27, 2017 · 2 comments
Closed

http.ClientRequest response object only emits close after abort? #17352

ronag opened this issue Nov 27, 2017 · 2 comments
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@ronag
Copy link
Member

ronag commented Nov 27, 2017

The response object from http.ClientRequest only seems to amit a close event if the request was aborted?

@mscdex mscdex added http Issues or PRs related to the http subsystem. question Issues that look for answers. labels Nov 27, 2017
@ronag
Copy link
Member Author

ronag commented Nov 27, 2017

Also, it seems to me that all errors are emitted on the request object and never on the response object. Is the 'error' listener even useful on the response object?

@dimonnwc3
Copy link

dimonnwc3 commented Dec 5, 2017

I see that end emits from http.IncomingMessage(as a client response) in success case and when server closes connection as well (fail). Shouldn't be only close/aborted without end?

trivikr added a commit to trivikr/node that referenced this issue Apr 15, 2018
@ronag ronag mentioned this issue Apr 25, 2018
3 tasks
addaleax pushed a commit that referenced this issue May 14, 2018
Fixes: #20102
Fixes: #20101
Fixes: #1735

- Response should always emit close.
- Response should always emit aborted if aborted.
- Response should always emit close after request has emitted close.

PR-URL: #20075
Fixes: #17352
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
3 participants