Skip to content

Conversation

@usualoma
Copy link
Member

fixes #270

In responseViaCache, we avoided searching for Transfer-Encoding because it was computationally expensive when the header object passed was a Record<string, string>. However, in this case, we assume that the body is not chunked if it is a string or Blob, so we would like to process it based on that assumption. (This has actually been the behavior so far.)
In responseViaResponseObject, we had also avoided referencing Transfer-Encoding to align with responseViaCache, but since there are actual issues like #270, I would like to avoid setting Content-Length if Transfer-Encoding is chunked.

@usualoma
Copy link
Member Author

@yusukebe
Would you please review this?

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

@usualoma

Thank you for the quick fix. Looks good! Merging.

@yusukebe yusukebe merged commit df6ea8e into honojs:main Aug 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue when using @hono/mcp, content-length is included when chunked encoding is used.

2 participants