Skip to content

http: emit aborted event on requests#64693

Open
simhnna wants to merge 1 commit into
nodejs:mainfrom
simhnna:emit-request-abort
Open

http: emit aborted event on requests#64693
simhnna wants to merge 1 commit into
nodejs:mainfrom
simhnna:emit-request-abort

Conversation

@simhnna

@simhnna simhnna commented Jul 23, 2026

Copy link
Copy Markdown

Currently the aborted event is never emitted on the request object. This merge request fixes that by ensuring the abort event is emitted on the request if the server hasn't finished reading the request or the response sending the response hasn't finished yet. It also improved the documentation to make it clear when close and abort events are emitted.

Fixes: #46666

I would welcome reverting the deprecation from the req aborted event, but didn't do that here. IMO it's much nicer for devs to be able to listen for client aborts in a single place (the request object).

Fixes: nodejs#46666

Signed-off-by: Simon Hanna <simon.hanna@aeb.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Jul 23, 2026
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. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detecting client request aborts in nodejs >= 15.50 is broken

2 participants