diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 1340b87a06100d..f2dd25e9856198 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -3313,9 +3313,7 @@ function socketOnClose() { code = null; } - const defaultCode = session[kType] === NGHTTP2_SESSION_SERVER ? - NGHTTP2_CANCEL : - NGHTTP2_INTERNAL_ERROR; + const defaultCode = NGHTTP2_INTERNAL_ERROR; const closeStream = (stream) => { if (code === null) { diff --git a/test/parallel/test-http2-respond-with-file-connection-abort.js b/test/parallel/test-http2-respond-with-file-connection-abort.js index 013560f0ce3d85..0f8993b8e43767 100644 --- a/test/parallel/test-http2-respond-with-file-connection-abort.js +++ b/test/parallel/test-http2-respond-with-file-connection-abort.js @@ -16,7 +16,7 @@ server.on('stream', common.mustCall((stream) => { stream.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_CANCEL' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' })); stream.respondWithFile(process.execPath, { [HTTP2_HEADER_CONTENT_TYPE]: 'application/octet-stream' diff --git a/test/parallel/test-http2-server-socket-destroy.js b/test/parallel/test-http2-server-socket-destroy.js index 6f52436fde505a..6b0ff60818143d 100644 --- a/test/parallel/test-http2-server-socket-destroy.js +++ b/test/parallel/test-http2-server-socket-destroy.js @@ -36,7 +36,7 @@ function onStream(stream) { stream.once('error', common.expectsError({ name: 'Error', code: 'ERR_HTTP2_STREAM_ERROR', - message: 'Stream closed with error code NGHTTP2_CANCEL' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' })); // Always send RST.