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

Return a piped response with compression enabled causes an unexpected error #3316

Open
ceifa opened this issue Aug 23, 2024 · 1 comment
Open
Labels

Comments

@ceifa
Copy link

ceifa commented Aug 23, 2024

What version of Hono are you using?

4.5.8

What runtime/platform is your app running on?

Node

What steps can reproduce the bug?

Enable the built-in compression:

app.use(compress());

Inside a hono route, do the following:

return await fetch(targetUrl, {
    method: req.method,
    headers,
    body: req.raw.body,
    duplex: 'half',
});

What is the expected behavior?

Response piped correctly.

What do you see instead?

TypeError: immutable
at _Headers.delete (node:internal/deps/undici/undici:3303:17)
at set res [as res] (file:///D:/whitewall/proxy/node_modules/hono/dist/context.js:62:31)
at compress2 (file:///D:/whitewall/proxy/node_modules/hono/dist/middleware/compress/index.js:12:13)

Additional information

It works on latest version of 3.x. Stopped in 4.x.

@nitedani
Copy link
Contributor

nitedani commented Aug 23, 2024

Edited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants