Skip to content

test(request): reject duplicate singleton headers - #78

Merged
ronag merged 1 commit into
nxtedition:masterfrom
ronag:codex/test-flat-header-duplicates-20260830
Aug 30, 2026
Merged

test(request): reject duplicate singleton headers#78
ronag merged 1 commit into
nxtedition:masterfrom
ronag:codex/test-flat-header-duplicates-20260830

Conversation

@ronag

@ronag ronag commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Port the four request-header boundary cases from nodejs/undici commit nodejs@74495c6.
  • Cover same-case and case-variant duplicates of Host and Content-Length in flat header arrays.
  • Assert validation rejects before any connector or network activity.

The lower runtime already has the upstream rejection logic, so this is deliberately a test-only port.

Validation

  • npm run test:unit -- --no-typescript (579 passing, 0 failing, 6 skipped)
  • npm run test:node-test -- --no-typescript (151 passing, 0 failing)
  • npm run test:types
  • npm run lint -- --no-cache
  • node --test test/headers-as-array.js (14 passing)
  • git diff --check

Copilot reviewed the exact head commit with no actionable findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR ports upstream Undici test cases to ensure Client.request() rejects duplicate singleton headers (Host and Content-Length) when headers are provided as a flat array, and verifies the rejection happens before any connection attempt.

Changes:

  • Added a shared helper to assert duplicate-header validation rejects and that no connector/network activity occurs.
  • Added four new tests covering same-case and case-variant duplicates of Host and Content-Length in flat header arrays.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ronag
ronag marked this pull request as ready for review August 30, 2026 06:43
@ronag
ronag merged commit 74c74bf into nxtedition:master Aug 30, 2026
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.

2 participants