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

2 participants