-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: return response from res.body if internal data is not ready to be returned directly #188
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e returned directly
@yusukebe Would you please review? |
yusukebe
approved these changes
Aug 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you! Good fix. I'll merge it and release a new version. |
adamnolte
referenced
this pull request
in autoblocksai/cli
Aug 19, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@hono/node-server](https://github.com/honojs/node-server) | [`1.12.0` -> `1.12.1`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.12.0/1.12.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@hono%2fnode-server/1.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@hono%2fnode-server/1.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@hono%2fnode-server/1.12.0/1.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@hono%2fnode-server/1.12.0/1.12.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>honojs/node-server (@​hono/node-server)</summary> ### [`v1.12.1`](https://github.com/honojs/node-server/releases/tag/v1.12.1) [Compare Source](https://github.com/honojs/node-server/compare/v1.12.0...v1.12.1) #### What's Changed - fix: return response from res.body if internal data is not ready to be returned directly by [@​usualoma](https://github.com/usualoma) in [https://github.com/honojs/node-server/pull/188](https://github.com/honojs/node-server/pull/188) **Full Changelog**: honojs/node-server@v1.12.0...v1.12.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Chicago, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/autoblocksai/cli). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This was referenced Sep 17, 2024
This was referenced Sep 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #186
"etag" middleware does
res.clone()
, but if you useBuffer.from
, the internal data is shared, so that once data is read with ’etag’, it could not be re-read on the server side.https://github.com/usualoma/hono/blob/915a8234975b8b875edcdf6a3acc8280dfc898af/src/middleware/etag/index.ts#L66
In such cases, if you read from
res.body
, the undici handles it well, so you can fallback tores.body
.