Skip to content

Commit

Permalink
fix(connect): add duplex when body is present #1566
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Mar 18, 2023
1 parent 35adfcc commit 141beec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/connect/deno/utils/hyper-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ export const fetchWithShim = (f: typeof fetch) =>
* so just manually build out the RequestInit for now.
*/
(req: Request): Promise<Response> =>
f(req.url, { headers: req.headers, method: req.method, body: req.body })
f(req.url, {
headers: req.headers,
method: req.method,
/**
* duplex needed for node
* See https://github.com/nodejs/node/issues/46221
*/
...(req.body ? { body: req.body, duplex: 'half' } : {}),
})

export const hyper = (conn: URL, domain: string) =>
async ({
Expand Down

0 comments on commit 141beec

Please sign in to comment.