镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(h2): preserve transport errors and mismatch causes - #6176

Merged
mcollina merged 1 commit into
nodejs:mainfrom
styfle:styfle/h2-preserve-transport-errors
Nov 7, 2026
Merged

mcollina merged 1 commit into
nodejs:mainfrom
styfle:styfle/h2-preserve-transport-errors

Conversation

@styfle

@styfle styfle commented Nov 6, 2026

Copy link
Copy Markdown
Member

This relates to...

Follow-up to #5816, which introduced HTTP/2 response Content-Length validation and the unconditional replacement of stream errors.

Rationale

When an HTTP/2 session fails after response headers arrive, the received body can be shorter than its Content-Length. The stream error handler currently replaces the transport failure with UND_ERR_RES_CONTENT_LENGTH_MISMATCH, discarding the original error code, message, and stack.

Changes

  • Preserve HTTP/2 session errors and other transport failures instead of converting every incomplete response into a length-mismatch error.
  • Limit conversion to Node's HTTP/2 protocol-error paths and attach the original error as cause.

Signed-off-by: Steven <steven@ceriously.com>
@codecov-commenter

codecov-commenter commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.68%. Comparing base (55bf294) to head (b437b46).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6176      +/-   ##
==========================================
+ Coverage   91.67%   91.68%   +0.01%     
==========================================
  Files         113      113              
  Lines       44443    44449       +6     
==========================================
+ Hits        40741    40751      +10     
+ Misses       3702     3698       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
mcollina merged commit e1a425c into nodejs:main Nov 7, 2026
38 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
@styfle
styfle deleted the styfle/h2-preserve-transport-errors branch November 9, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants