Repository navigation
http - http.ClientRequest doesn't emit 'aborted'? #15259
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Description
Activity
- changed the title
[-]HTTP request 'aborted'[/-][+]HTTP request missing 'aborted'[/+]on Sep 8, 2017 - changed the title
[-]HTTP request missing 'aborted'[/-][+]HTTP request missing 'aborted' event[/+]on Sep 8, 2017 - changed the title
[-]HTTP request missing 'aborted' event[/-][+] http.ClientRequest doesn't emit 'aborted'?[/+]on Sep 8, 2017 - addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Sep 8, 2017 Yes, it's incorrect. It may have been copy/pasted from
http.IncomingMessage, which does emit it.- changed the title
[-] http.ClientRequest doesn't emit 'aborted'?[/-][+]http - http.ClientRequest doesn't emit 'aborted'?[/+]on Sep 8, 2017 For posterity @ronag I am pasting in the permalink of the line that you referenced in code
so that when the code is shuffled around, we can always refer to it.Line 366 in c79fd2b
req.res.emit('aborted'); Also this issue precedes and seems like it is related to #15283, should we be folding #15283 in here?
The documentation for this event should be moved tohttp.ServerResponse.Edit: nvm.
- added a commit that references this issue
on Sep 19, 2017 - added a commit that references this issue
on Sep 23, 2017 - added a commit that references this issue
on Sep 25, 2017 - added a commit that references this issue
on Oct 17, 2017 - added a commit that references this issue
on Oct 25, 2017 - added a commit that references this issue
on Jul 27, 2026
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Looking through the _http_client.js code it seems to me that the
http.ClientRequestobject never emits an ´aborted´ event (onlyclose). It's just the response object that emits theabortedevent.https://github.com/nodejs/node/blob/master/lib/_http_client.js#L366
That seems to go against the docs, https://nodejs.org/api/http.html#http_event_aborted