-
Notifications
You must be signed in to change notification settings - Fork 72
Open
honojs/hono
#4100Description
Environment
- [email protected] + @hono/[email protected]
- Windows + Node.js 22.13.1
Steps to reproduce
- Set
precompressed: true
forserveStatic()
- Call
c.res
as in the following code - Prepare the compressed file (e.g.
with-compressed.html
andwith-compressed.html.br
) - Content-Type is set to
text/plain;charset=UTF-8
😥
app.use(
serveStatic({
root: "static",
precompressed: true,
onFound: (_path, c) => {
const { res } = c;
},
})
);
Minimal Reproducible Example
I have created MRE in the following repository.
https://github.com/SaekiTominaga/mre-hono-static-compress-node
npm run dev1
→http://localhost:3000/with-compressed.html
returnstext/html
👍npm run dev2
→http://localhost:3000/with-compressed.html
returnstext/plain
👎npm test
→ "called `c.res` – with compressed" test fails
Metadata
Metadata
Assignees
Labels
No labels