-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
NotFound Handler + Compress does not return body #2061
Comments
@sebastianwessel i tested with 3.12.6 and wrote this test, it works as expected, will check with @hono/node-server
|
@sebastianwessel issue was that compress + hono + hono/node-server were not working correctly, when middleware compress is used. I fixed this so when content-encoding is gzip or deflate it is compressing the body with specific encoding. Hono currently implements gzip and deflates. Tomorrow i will issue PR for this fix in hono/node-server. |
@usualoma thanks for the solution, but there is another bug, when running with this test:
test fails with SyntaxError: Unexpected token in JSON at position 0 |
Hi @ariskemper I haven't actually tried it, but I think in this case you need to do the gunzip process yourself. I think you are getting an error because you are not doing that here. expect(JSON.parse(zlib.gunzipSync(await res.text()))) |
@usualoma thanks for the hint, ok looks good to me, will bump hono to v3.12.7 in @hono/node-server and will add some extra tests in @hono/node-server with content decompression, what do you think? |
@ariskemper Thank you. I am happy to have the test added. |
What version of Hono are you using?
3.12.6
What runtime/platform is your app running on?
Node
What steps can reproduce the bug?
What is the expected behavior?
Returns error body:
What do you see instead?
No body content - browser default error page
Additional information
Might be an issue in hono + compress or maybe in
@hono/node-server
package, as there were similar issues in regular handlers in older versionsThe text was updated successfully, but these errors were encountered: