feat: use internal body if available for returning the response in its original form as much as possible#145
Merged
yusukebe merged 4 commits intohonojs:mainfrom Feb 17, 2024
Conversation
…esponse This change cherry-picks some of the following commits b5ba8dd Thanks to @tangye1234 for the original implementation.
…s original form as much as possible
Member
Author
|
@yusukebe Would you please review? |
Member
Author
|
By the way, the following code is still used. Lines 96 to 130 in a25fa2a Removing this will cause the following tests to fail node-server/test/server.test.ts Lines 78 to 83 in a25fa2a |
nicolewhite
referenced
this pull request
in seekoai/cli
Mar 20, 2024
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@hono/node-server](https://togithub.com/honojs/node-server) | [`1.7.0` -> `1.8.2`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.7.0/1.8.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>honojs/node-server (@​hono/node-server)</summary> ### [`v1.8.2`](https://togithub.com/honojs/node-server/releases/tag/v1.8.2) [Compare Source](https://togithub.com/honojs/node-server/compare/v1.8.1...v1.8.2) #### What's Changed - fix: duplex only has a getter by [@​wenerme](https://togithub.com/wenerme) in [https://github.com/honojs/node-server/pull/149](https://togithub.com/honojs/node-server/pull/149) #### New Contributors - [@​wenerme](https://togithub.com/wenerme) made their first contribution in [https://github.com/honojs/node-server/pull/149](https://togithub.com/honojs/node-server/pull/149) **Full Changelog**: honojs/node-server@v1.8.1...v1.8.2 ### [`v1.8.1`](https://togithub.com/honojs/node-server/releases/tag/v1.8.1) [Compare Source](https://togithub.com/honojs/node-server/compare/v1.8.0...v1.8.1) This release includes a `feat` change, but it's minor, so release this as a patch-release. #### What's Changed - feat: support keepalive property for Request object by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/node-server/pull/148](https://togithub.com/honojs/node-server/pull/148) **Full Changelog**: honojs/node-server@v1.8.0...v1.8.1 ### [`v1.8.0`](https://togithub.com/honojs/node-server/releases/tag/v1.8.0) [Compare Source](https://togithub.com/honojs/node-server/compare/v1.7.0...v1.8.0) #### What's Changed - feat: bump hono to v3.12.8, add customer err tests for compress middl… by [@​ariskemper](https://togithub.com/ariskemper) in [https://github.com/honojs/node-server/pull/130](https://togithub.com/honojs/node-server/pull/130) - refactor(test): replace features to be removed in v4 by [@​ryuapp](https://togithub.com/ryuapp) in [https://github.com/honojs/node-server/pull/136](https://togithub.com/honojs/node-server/pull/136) - Catch when nodejs request is aborted by [@​M4RC3L05](https://togithub.com/M4RC3L05) in [https://github.com/honojs/node-server/pull/141](https://togithub.com/honojs/node-server/pull/141) - chore: bump hono to v4 by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/node-server/pull/143](https://togithub.com/honojs/node-server/pull/143) - feat: use internal body if available for returning the response in its original form as much as possible by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/node-server/pull/145](https://togithub.com/honojs/node-server/pull/145) #### New Contributors - [@​ariskemper](https://togithub.com/ariskemper) made their first contribution in [https://github.com/honojs/node-server/pull/130](https://togithub.com/honojs/node-server/pull/130) - [@​ryuapp](https://togithub.com/ryuapp) made their first contribution in [https://github.com/honojs/node-server/pull/136](https://togithub.com/honojs/node-server/pull/136) - [@​M4RC3L05](https://togithub.com/M4RC3L05) made their first contribution in [https://github.com/honojs/node-server/pull/141](https://togithub.com/honojs/node-server/pull/141) **Full Changelog**: honojs/node-server@v1.7.0...v1.8.0 </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 has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/autoblocksai/cli). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or 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
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 #144
Reuse the following implementation idea to get the body inside the nodejs Response object and use it to return a response if available.
node-server/src/utils.ts
Lines 13 to 24 in a8117ce