diff --git a/lib/dispatcher/client-h2.js b/lib/dispatcher/client-h2.js index 7d619fac4f6..ef6d47a0c9c 100644 --- a/lib/dispatcher/client-h2.js +++ b/lib/dispatcher/client-h2.js @@ -510,16 +510,18 @@ function writeH2 (client, request) { }) stream.once('error', function (err) { + stream.removeAllListeners('data') abort(err) }) stream.once('frameError', (type, code) => { + stream.removeAllListeners('data') abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)) }) - // stream.on('aborted', () => { - // // TODO(HTTP/2): Support aborted - // }) + stream.on('aborted', () => { + stream.removeAllListeners('data') + }) // stream.on('timeout', () => { // // TODO(HTTP/2): Support timeout