Cloudflare Rewritter not working properly on hono 3 and superior #1486
Replies: 2 comments 2 replies
-
Hi @Stuntback46 That seems to be working well in my environment. Is this a wrong way to reproduce? |
Beta Was this translation helpful? Give feedback.
-
Hello, @yusukebe , thanks for your reply, basically the issue happen when the server behind answer with a content length so the page stop loading once the content length reached (If you rewrite we lot of content for example). I did a dirty solution like that and it works, the issue is we modify the server response even when we did not rewrite anything:
So to reproduce you need to check if you answer with Content-Length header and need to inject lot of content for example a whole paragraph of text. Thanks again for your help! |
Beta Was this translation helpful? Give feedback.
-
If I run that code the Long Lorem ipsum get cut and if I comment
app.get('*', async (c, next) => { const res = await fetch(c.req.raw) return new Response(res.body, res) })
and uncomment// app.get('*', async(c) => { // const res = await fetch(c.req.raw) // const test = await res.text() // return c.html( // test // ) // })
It work but I am loosing the server headerHere an example of what the server answer:
Could you please help, this was working with hono 2.5.8 and except rewriting the body I should not modify the server response.
Beta Was this translation helpful? Give feedback.
All reactions