Skip to content

Commit dbe02ea

Browse files
committed
fix: use encoded byte length instead of string length for chunking loop
Fixes: BRAPI-867
1 parent a02b7a2 commit dbe02ea

File tree

1 file changed

+1
-1
lines changed
  • packages/playwright-cloudflare/src/cloudflare

1 file changed

+1
-1
lines changed

packages/playwright-cloudflare/src/cloudflare/chunking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const messageToChunks = (data: string): Uint8Array[] => {
1818
);
1919

2020
const chunks: Uint8Array[] = [firstChunk];
21-
for (let i = FIRST_CHUNK_DATA_SIZE; i < data.length; i += MAX_MESSAGE_SIZE)
21+
for (let i = FIRST_CHUNK_DATA_SIZE; i < encodedUint8Array.length; i += MAX_MESSAGE_SIZE)
2222
chunks.push(encodedUint8Array.slice(i, i + MAX_MESSAGE_SIZE));
2323

2424
return chunks;

0 commit comments

Comments
 (0)