-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
Content-Encoding
header is gzip
without compression middleware
#3449
Comments
It's not a bug. Cloudflare adds the export default {
fetch: () => new Response('Hello'),
} |
Oh, I see. Would it be worth considering overwriting this header for streams? I believe it's theoretically possible to stream data with gzip as well, but I couldn't get it to work quickly and it took me forever to figure out that this was the issue. 😅 To be honest, I don't know exactly how gzip works with HTTP, but is the header even correct, like is the response even gzipped? As soon as I overwrote the header with "none", the stream worked perfectly without me having to do any decoding myself (like gzip decoding, for example). |
Hi @poeck Thank you for the comment. Actually, it does not work on Cloudflare Workers without modifying the c.header('Content-Encoding', 'Identity') I can't find good documentation explaining I think it's a good idea to set cc: @sor4chi @watany-dev What do you think of it? |
Hi @yusukebe. |
I'm trying to add a change to set |
In the |
Mainly to @sor4chi Thank you for your review of #3476. I've re-thought about this issue. As the issue on Cloudflare Workers SDK: cloudflare/workers-sdk#6577, the fact that streaming is not enabled on Wrangler may be a Wrangler-side problem. This means streaming works well on Cloudflare's production, but it does not work on the current Wrangler. If so, it's not good to fix this issue on the framework (Hono) side. The Cloudflare internal team has started investigating it, but we don't know when it will be resolved. We can make some choices
I prefer "2". What do you think of it? |
Okay, I think 2 is fine with me too. |
I've added the description on the docs honojs/website#507 to close this issue. Thank you so much! |
What version of Hono are you using?
4.5.8
What runtime/platform is your app running on?
Cloudflare Workers
What steps can reproduce the bug?
What is the expected behavior?
The
Content-Encoding
should probably not be present if there is nocompress
middle ware applied.What do you see instead?
The
Content-Encoding
is automatically set togzip
.Additional information
When trying to stream text with
streamText
fromhono/streaming
you need to manually addc.header("Content-Encoding", "none")
for it to work correctly.The text was updated successfully, but these errors were encountered: