diff --git a/packages/hono/src/index.ts b/packages/hono/src/index.ts index 7bf4a25260..c1891eb313 100644 --- a/packages/hono/src/index.ts +++ b/packages/hono/src/index.ts @@ -55,10 +55,13 @@ function convertToStandardRequest(req: HonoRequest): Request { headers[key] = value; } + // https://developer.mozilla.org/en-US/docs/Web/API/fetch#body + const includeBody = ["GET", "HEAD"].includes(req.raw.method); + return new Request(req.raw.url, { method: req.raw.method, headers, - body: req.raw.body, + body: includeBody ? req.raw.body : undefined, // @ts-ignore duplex: "half", }); diff --git a/packages/nextjs/src/index.ts b/packages/nextjs/src/index.ts index ba5d811f1e..6d876e8fba 100644 --- a/packages/nextjs/src/index.ts +++ b/packages/nextjs/src/index.ts @@ -70,12 +70,15 @@ async function convertToStandardRequest(nextReq: NextApiRequest): Promise