Skip to content

fix(http): align IncomingMessage headers and encoding - #3525

Merged
proggeramlug merged 5 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-http-incoming-message
May 31, 2026
Merged

proggeramlug merged 5 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-http-incoming-message

Conversation

@andrewtdiz

Copy link
Copy Markdown
Contributor

Closes #3272
Closes #3273
Closes #3416

Summary

  • Materialize server-side IncomingMessage.headers for statically tagged request handlers.
  • Emit server request data chunks as Buffer objects by default so Buffer.concat() works.
  • Add callable, chainable IncomingMessage.setEncoding() for client responses and server request handles, switching future data chunks to decoded strings.
  • Wire the new surface through native call tables, runtime declarations, handle/property dispatch, and the API manifest.

Why Batched

These issues all cover the node:http IncomingMessage request/response stream surface and share the same stdlib/runtime dispatch paths, so one patch avoids duplicating fixture setup and handle-routing changes.

Tests Added

  • test-parity/node-suite/http/incoming-message/client-set-encoding.ts
  • test-parity/node-suite/http/incoming-message/server-headers-body.ts

Verification

  • Pre-fix repro: PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module http failed the new incoming-message fixtures as expected; report test-parity/reports/parity_report_20260531_042106.json.
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module http/incoming-message passed 2/2; report test-parity/reports/parity_report_20260531_050116.json.
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module http passed 9/10 with only the existing node-suite/http/server/upgrade-websocket output mismatch remaining; report test-parity/reports/parity_report_20260531_050245.json.
  • RUSTC_WRAPPER= cargo check -p perry-runtime -p perry-codegen -p perry-hir -p perry-api-manifest -p perry -p perry-stdlib -p perry-ext-http -p perry-ext-http-server passed with existing warnings.
  • cargo fmt --all -- --check passed.
  • ./scripts/check_file_size.sh passed.
  • jq empty test-parity/known_failures.json passed.
  • git diff --check passed.

Non-Goals

  • Does not change rawHeaders original casing preservation.
  • Does not fix client request Buffer body writes.
  • Does not address the pre-existing http/server/upgrade-websocket parity output mismatch.
  • Does not complete the broader IncomingMessage metadata/timeout surface tracked separately.

@proggeramlug
proggeramlug merged commit 77e7b2f into PerryTS:main May 31, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants