Skip to content
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

Responding with boxed strings breaks HTTP server #25203

Closed
Mabi19 opened this issue Aug 25, 2024 · 3 comments
Closed

Responding with boxed strings breaks HTTP server #25203

Mabi19 opened this issue Aug 25, 2024 · 3 comments
Labels
bug Something isn't working correctly ext/http related to ext/http

Comments

@Mabi19
Copy link

Mabi19 commented Aug 25, 2024

Version: Deno 1.46.0 and 1.46.1 (does not happen on 1.45.5 and below)
OS: Windows 11 / Linux (Debian 12)

Returning a Response made with a boxed string in the Deno.serve callback results in multiple calls to the handler per request and no data actually being sent, resulting in a "connection reset" / "empty response" error on the client-side.

Deno.serve(() => new Response(new String("uh oh!") as string));

Boxed strings are occasionally sent by Hono apps, like this one:

// assuming import map entry for "hono" exists
import { Hono } from "hono";
import { html } from "hono/html";

const app = new Hono();

app.get("/", (ctx) => {
    console.log("this will be logged multiple times!");
    return ctx.html(
        Promise.resolve(html`<div></div>`),
    );
});

Deno.serve(app.fetch);
@lucacasonato
Copy link
Member

Caused by ba40347. Trying to figure out right now whether this is intentional or not.

@marvinhagemeister marvinhagemeister added the bug Something isn't working correctly label Aug 26, 2024
@lucacasonato lucacasonato added the ext/http related to ext/http label Aug 26, 2024
@lucacasonato
Copy link
Member

Yup, definitely a bug.

lucacasonato added a commit that referenced this issue Aug 26, 2024
Unfortunately this caused a regression:
#25203.

Need to do some more upstream spec work to fix this before this can be
re-landed.

Reverts #24623
@lucacasonato
Copy link
Member

Fixed in #25207

lucacasonato added a commit that referenced this issue Aug 29, 2024
Unfortunately this caused a regression:
#25203.

Need to do some more upstream spec work to fix this before this can be
re-landed.

Reverts #24623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ext/http related to ext/http
Projects
None yet
Development

No branches or pull requests

3 participants