Skip to content

fix(ext/http): join split request headers consistently - #35081

Merged
nathanwhit merged 1 commit into
denoland:mainfrom
nathanwhit:codex/http-split-header-concat
Jun 10, 2026
Merged

nathanwhit merged 1 commit into
denoland:mainfrom
nathanwhit:codex/http-split-header-concat

Conversation

@nathanwhit

@nathanwhit nathanwhit commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

Browsers can send split Cookie fields over HTTP/2. Deno already joined cookies with "; " for bulk request-header exposure and the raw backend, but the hyper-backed single-header getter used the generic ", " separator. That made req.headers.get("cookie") disagree with iteration and broke cookie parsing for frameworks that read cookies through get().

This change centralizes request-header value separator selection, applies it to the hyper single-header getter, and keeps the raw and bulk paths on the same rule. It also adds raw HTTP/1 and raw HTTP/2 tests that send physically split Cookie and generic X-Test fields, then assert both headers.get() and header iteration produce consistent combined values.

Validation:

deno run --allow-read --allow-write --allow-run --allow-net ./tools/format.js
cargo build -p deno --bin deno
./target/debug/deno test --config tests/config/deno.json --no-lock --allow-all --location=http://js-unit-tests/foo/bar --filter httpServerHttp1SplitHeaderConcatenation tests/unit/serve_test.ts
./target/debug/deno test --config tests/config/deno.json --no-lock --allow-all --location=http://js-unit-tests/foo/bar --filter httpServerHttp2SplitHeaderConcatenation tests/unit/serve_test.ts

@nathanwhit
nathanwhit marked this pull request as ready for review June 9, 2026 23:37
@nathanwhit
nathanwhit enabled auto-merge (squash) June 9, 2026 23:38
@nathanwhit
nathanwhit disabled auto-merge June 9, 2026 23:43
@nathanwhit
nathanwhit merged commit eb44004 into denoland:main Jun 10, 2026
173 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

Development

Successfully merging this pull request may close these issues.

1 participant