Open
Description
What version of Hono are you using?
4.7.0
What runtime/platform is your app running on? (with version if possible)
Cloudflare Workers
What steps can reproduce the bug?
The following code DOESN'T work
ctx.text(await res.text(), {
headers: {
'Content-Type': 'text/javascript',
},
});
The following code DOES work
ctx.body(await res.text(), {
headers: {
'Content-Type': 'text/javascript',
},
});
You should make text
function (but probably also json
and others) to omit Content-Type
header from his typescript type...
What is the expected behavior?
if it doesn't work typescript should complain (also javascript because you shouldn't be able to do a thing like this at all)
What do you see instead?
no error but wrong Content-Type
(text/plain
in my case)
Additional information
No response