Skip to content

Commit

Permalink
default to NGHTTP2_INTERNAL_ERROR
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Oct 8, 2024
1 parent 8381e02 commit c9eb300
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-server-socket-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c9eb300

Please sign in to comment.