Skip to content

quic: convert incoming :status header to number#63589

Open
hallss93 wants to merge 1 commit into
nodejs:mainfrom
hallss93:quic-h3-status-number
Open

quic: convert incoming :status header to number#63589
hallss93 wants to merge 1 commit into
nodejs:mainfrom
hallss93:quic-h3-status-number

Conversation

@hallss93
Copy link
Copy Markdown

@hallss93 hallss93 commented May 26, 2026

Fixes: #63557

Summary

When receiving HTTP/3 headers via QUIC, headers[':status'] was exposed as a
string. HTTP/2 converts the incoming :status pseudo-header to a number in
toHeaderObject() (lib/internal/http2/util.js). This mismatch makes it
awkward to port HTTP/2 code to HTTP/3.

Align HTTP/3 with HTTP/2 by converting :status to a number in
parseHeaderPairs() when building the header object from C++ name/value
pairs. This applies to initial response headers, informational (1xx)
headers (oninfo), and stream.headers.

Outgoing headers are unchanged: callers may still pass ':status': '200' or
':status': 200 when calling sendHeaders() / sendInformationalHeaders().

Test plan

  • Update existing QUIC H3 tests to expect numeric :status on receive

  • Add test/parallel/test-quic-h3-status-code-type.mjs covering 200, 204, and 404

  • Run (with QUIC enabled):

    node --experimental-quic --experimental-stream-iter --no-warnings \
      test/parallel/test-quic-h3-status-code-type.mjs \
      test/parallel/test-quic-h3-header-validation.mjs \
      test/parallel/test-quic-h3-informational-headers.mjs \
      test/parallel/test-quic-h3-request-response.mjs

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels May 26, 2026
@pimterry
Copy link
Copy Markdown
Member

@hallss93 Looks like the commit message here is failing the linting as it's not signed off, you'll need to update that with git commit --amend -s and then force push.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (92f48f4) to head (f442353).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63589      +/-   ##
==========================================
+ Coverage   90.31%   90.32%   +0.01%     
==========================================
  Files         730      730              
  Lines      234653   234658       +5     
  Branches    43952    43951       -1     
==========================================
+ Hits       211926   211959      +33     
+ Misses      14474    14430      -44     
- Partials     8253     8269      +16     
Files with missing lines Coverage Δ
lib/internal/quic/quic.js 100.00% <100.00%> (ø)

... and 32 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quic: http/3 headers behave differently than http/2

4 participants