fix(runtime-sdk): preserve repeated response headers (multiple Set-Cookie) - #167
Open
whitphx wants to merge 2 commits into
Open
fix(runtime-sdk): preserve repeated response headers (multiple Set-Cookie)#167whitphx wants to merge 2 commits into
Set-Cookie)#167whitphx wants to merge 2 commits into
Conversation
Set-Cookie)
ryanking13
reviewed
Aug 3, 2026
ryanking13
left a comment
Contributor
There was a problem hiding this comment.
Thanks! I left one comment about reusing the existing code, otherwise looks good to me.
whitphx
force-pushed
the
fix/asgi-duplicate-response-headers
branch
from
August 6, 2026 18:37
c1e2e40 to
0270d6b
Compare
whitphx
force-pushed
the
fix/asgi-duplicate-response-headers
branch
from
August 10, 2026 05:25
0270d6b to
67a8bce
Compare
ryanking13
reviewed
Aug 11, 2026
…ookie`) Object.fromEntries collapses repeated header names to the last value per name, dropping all but one Set-Cookie. Build the response headers with the SDK's own _to_js_headers helper, which keeps them as a js.Headers.
whitphx
force-pushed
the
fix/asgi-duplicate-response-headers
branch
from
August 11, 2026 06:33
67a8bce to
44d42dc
Compare
…apper response.headers exposes an http.client.HTTPMessage, whose get_all() returns every value for a repeated name, so the test no longer reaches through js_object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building a header object with
Object.fromEntries(headers)drops repeated header contents.For example, when a response endpoint returns the header like this,
Through the current bridge,
Object.fromEntriescollapses the pair and the client receives only:This PR fixes it by building the headers with the SDK's own
_to_js_headershelper, which keeps them as ajs.Headers.pytest -k asgiinpackages/runtime-sdkruns the workerd suite, which asserts both cookies survive the round trip.