Skip to content
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

feat(trpc-server): use c.body to create response to avoid header loss #517

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-plants-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hono/trpc-server': patch
---

use `c.body` to create response to avoid header loss
4 changes: 2 additions & 2 deletions packages/trpc-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"homepage": "https://honojs.dev",
"peerDependencies": {
"@trpc/server": "^10.10.0",
"hono": ">=3.*"
"hono": ">=4.*"
},
"devDependencies": {
"@trpc/server": "^10.10.0",
"hono": "^3.11.7",
"hono": "^4.3.6",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"zod": "^3.20.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/trpc-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const trpcServer = ({
}),
endpoint,
req: c.req.raw,
})
}).then((res) => c.body(res.body, res))
return res
}
}
11 changes: 9 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2094,13 +2094,13 @@ __metadata:
resolution: "@hono/trpc-server@workspace:packages/trpc-server"
dependencies:
"@trpc/server": "npm:^10.10.0"
hono: "npm:^3.11.7"
hono: "npm:^4.3.6"
jest: "npm:^29.7.0"
rimraf: "npm:^5.0.5"
zod: "npm:^3.20.2"
peerDependencies:
"@trpc/server": ^10.10.0
hono: ">=3.*"
hono: ">=4.*"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -9640,6 +9640,13 @@ __metadata:
languageName: node
linkType: hard

"hono@npm:^4.3.6":
version: 4.3.6
resolution: "hono@npm:4.3.6"
checksum: 2e27eb1e90b392a5884af573179d29e3f717f5e803c2b90f1383488f42bc986810e8e714d5bb1205935fda1d3e9944b3262aed88e852ea44d0e13d799474fa5b
languageName: node
linkType: hard

"hosted-git-info@npm:^2.1.4":
version: 2.8.9
resolution: "hosted-git-info@npm:2.8.9"
Expand Down