### Runtime node.js ### Runtime version 24 ### Module version 21.4.4 ### Last module version without issue Node 17 ### Used with hapi application ### Any other relevant information The `Request.active()` function always returns true. The `abort` event on NodeJS's `http.ClientRequest` has been deprecated since NodeJS v17, and `hapi/lib/request.js` is depending on that function. [1] https://github.com/hapijs/hapi/blob/master/lib/request.js#L328 [2] https://nodejs.org/api/http.html#event-abort ### What are you trying to achieve or the steps to reproduce? When spamming my F5 key on my browser with a request with an intentional delay, the request never got cancelled, and `active()` always returned true. ### What was the result you got? The requests were never cancelled. ### What result did you expect? I wrote a small plugin to work around the issue: ```ts export const plugin: Plugin<object> = { name: 'earlyCancel', register(server) { server.ext('onPreAuth', (request, tk) => { request.app.disconnected = false; request.raw.req.on('close', () => { if (!request.raw.res.writableEnded) { request.app.disconnected = true; } }); return tk.continue; }); }, }; ``` And verify that when spamming F5, I was able to get some requests to be cancelled.
Activity
akashbirajdar04 commentedon Apr 30, 2026
Hi, I’d like to work on this issue. Could you please assign it to me?
damusix commentedon May 19, 2026
@akashbirajdar04 you're free to open a PR whenever. Looks like there's already a PR in order.