From 7f91691ba21483b85fccbb8ef6caacb4f3b98d0f Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 22 Mar 2024 11:25:41 -0700 Subject: [PATCH] fix: timeout for betweenBytesTiemout and firstByteTimeout (#409) --- packages/preview2-shim/lib/io/worker-http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/preview2-shim/lib/io/worker-http.js b/packages/preview2-shim/lib/io/worker-http.js index 1298fa2eb..4d067d9f5 100644 --- a/packages/preview2-shim/lib/io/worker-http.js +++ b/packages/preview2-shim/lib/io/worker-http.js @@ -150,10 +150,10 @@ export async function createHttpRequest( req.once("close", () => reject); req.once("error", reject); }); - if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout)); + if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout / 1_000_000n)); if (betweenBytesTimeout) res.once("readable", () => { - res.setTimeout(Number(betweenBytesTimeout)); + res.setTimeout(Number(betweenBytesTimeout / 1_000_000n)); }); const bodyStreamId = createReadableStream(res); return {