diff --git a/lib/dispatcher/client-h2.js b/lib/dispatcher/client-h2.js index 71cf1276a2b..eaaa4d75d59 100644 --- a/lib/dispatcher/client-h2.js +++ b/lib/dispatcher/client-h2.js @@ -501,16 +501,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