Skip to content

Commit a91378c

Browse files
committed
fix(runtime): hand the rebuilt door request an ArrayBuffer-backed body
The CLI package's test-layer typecheck reaches runtime source and refuses a Uint8Array over a possibly shared buffer as BodyInit (TS2322). Copy the raw body bytes into a plain view. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZu8LTZdVjqiEi4pci
1 parent a49f47b commit a91378c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/runtime/src/forwarded-door-fallback.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export async function toWebRequest(req: FallbackRequestLike): Promise<Request> {
7979
const init: RequestInit = { method, headers };
8080
if (method !== 'GET' && method !== 'HEAD' && typeof req.rawBody === 'function') {
8181
const bytes = await req.rawBody();
82-
if (bytes.byteLength > 0) init.body = bytes;
82+
// Copied into a plain `ArrayBuffer`-backed view: `BodyInit` does not
83+
// take a view over a possibly shared buffer.
84+
if (bytes.byteLength > 0) init.body = new Uint8Array(bytes);
8385
}
8486
return new Request(url, init);
8587
}

0 commit comments

Comments
 (0)