Repository navigation
Conversation
Added tests to verify header merging behavior in fetch requests.
Refactor header handling to delete existing keys before appending new ones.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Resolves #655.
Normalize request headers before overlaying defaults so repeated tuple values follow the native
Headersbehavior. Remove overridden default names first, then append request entries. This preserves separateSet-Cookieentries as well as combinedAcceptvalues, while keeping request-over-default precedence.Adds regression tests for repeated tuples with unrelated and same-name defaults, separate
Set-Cookieentries, and input/default immutability.The earlier attempt in #656 is closed and unmerged. It used the same normalization and delete/append approach; this PR includes an additional
Set-Cookieregression.Verification
Local Node 22.23.5, pnpm 10.20.0:
pnpm test: lint and coverage run passed, 30 tests passed.pnpm exec tsc --noEmit: passed.pnpm build: passed.Headerswith separateSet-Cookieentries, empty input, and no input/default mutation.Not run locally: Node 20/24 CI matrix, browsers, Deno, or alternate
Headersimplementations. ThegetSetCookie()regression uses the native Node implementation.Compatibility note: malformed tuples with other than two elements now throw through the
Headersconstructor even when defaults exist, matching the existing no-defaults path.AI assistance was used for implementation and static review. The local execution results above are separate from those reviews.
Summary by CodeRabbit
AcceptandSet-Cookievalues. Existing defaults and supplied header entries remain unchanged.