hono
hono copied to clipboard
Return a piped response with compression enabled causes an unexpected error
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.
Edited
This was closed by https://github.com/honojs/hono/pull/3318. Thanks.