diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index b5b5c17897b1c3..92ce193b0078a8 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -27,6 +27,7 @@ const { SafeSet, StringPrototypeSlice, Symbol, + SymbolDispose, TypedArrayPrototypeGetLength, Uint32Array, Uint8Array, @@ -1810,10 +1811,8 @@ class ClientHttp2Session extends Http2Session { if (signal.aborted) { aborter(); } else { - signal.addEventListener('abort', aborter); - stream.once('close', () => { - signal.removeEventListener('abort', aborter); - }); + const disposable = EventEmitter.addAbortListener(signal, aborter); + stream.once('close', disposable[SymbolDispose]); } }