Skip to content

Commit

Permalink
fix request types
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Jan 6, 2025
1 parent fa1128a commit 0a1cfe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/start/src/runtime/server-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ async function handleServerFunction(h3Event: HTTPEvent) {
// This should never be the case in "proper" Nitro presets since node.req has to be IncomingMessage,
// But the new azure-functions preset for some reason uses a ReadableStream in node.req (#1521)
const isReadableStream = h3Request instanceof ReadableStream;
const hasReadableStream = h3Request.body instanceof ReadableStream;
const hasReadableStream = (h3Request as EdgeIncomingMessage).body instanceof ReadableStream;
const isH3EventBodyStreamLocked =
(isReadableStream && h3Request.locked) || (hasReadableStream && h3Request.body.locked);
(isReadableStream && h3Request.locked) || (hasReadableStream && ((h3Request as EdgeIncomingMessage).body as ReadableStream).locked);
const requestBody = isReadableStream ? h3Request : h3Request.body;

if (
Expand Down

0 comments on commit 0a1cfe7

Please sign in to comment.