Skip to content

fix(ext/http): require genuine Response returned from Deno.serve #29106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lucacasonato
Copy link
Member

Follow up from #29105 and #29056.

Deno.serve should have been checking for genuine Response objects using an
internal slot check, not using prototype checks.

lucacasonato and others added 3 commits April 30, 2025 11:32
…use correct `rawHeaders` structure (#29056)"

This reverts commit 0557466.
…ct `rawHeaders` structure

Fixes #28022

Previously, when a user manipulated the global `Response` object, we
would use that object when passing the response from the Node shim to
`Deno.serve`. This caused issues when the user manipulated the
`Response` object in a way that would break `Deno.serve`.

The raw headers bug is that we were exposing the `rawHeaders` field on
`Incoming` as a `Headers` object, instead it's supposed to be a flat
array of the header keys + values. I.e. `["Content-Type:",
"application/json", "Host:", "http://localhost"]`

Co-authored-by: Nathan Whitaker <[email protected]>
@lucacasonato lucacasonato requested a review from nathanwhit April 30, 2025 09:50
@lucacasonato lucacasonato changed the title fix(ext/http): require genuuine Response returned from Deno.serve fix(ext/http): require genuine Response returned from Deno.serve Apr 30, 2025
Base automatically changed from deno_serve_cleanup to main April 30, 2025 16:23
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