Skip to content

Commit a46c5af

Browse files
unstubbableeps1lon
authored andcommitted
Bumping the array count is not needed for Blobs
1 parent df0aa0d commit a46c5af

2 files changed

Lines changed: 0 additions & 28 deletions

File tree

packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -757,29 +757,4 @@ describe('ReactFlightDOMReply', () => {
757757
}
758758
expect(error.message).toContain('Referenced Blob is not a Blob.');
759759
});
760-
761-
it('cannot deserialize nested arrays with Blob references exceeding the size limit', async () => {
762-
const formData = new FormData();
763-
formData.set('1', new Blob([new Uint8Array(400_000)]));
764-
const n = 15;
765-
formData.set('2', JSON.stringify(['$B1', '$B1', '$B1']));
766-
for (let i = 3; i < n; i++) {
767-
formData.set(
768-
String(i),
769-
JSON.stringify([
770-
'$' + (i - 1).toString(16),
771-
'$' + (i - 1).toString(16),
772-
'$' + (i - 1).toString(16),
773-
]),
774-
);
775-
}
776-
formData.set('0', JSON.stringify('$' + (n - 1).toString(16)));
777-
let error;
778-
try {
779-
await ReactServerDOMServer.decodeReply(formData, webpackServerMap);
780-
} catch (x) {
781-
error = x;
782-
}
783-
expect(error.message).toContain('Maximum array nesting exceeded');
784-
});
785760
});

packages/react-server/src/ReactFlightReplyServer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,9 +1810,6 @@ function parseModelString(
18101810
if (!(backingEntry instanceof Blob)) {
18111811
throw new Error('Referenced Blob is not a Blob.');
18121812
}
1813-
if (arrayRoot !== null) {
1814-
bumpArrayCount(arrayRoot, backingEntry.size, response);
1815-
}
18161813
return backingEntry;
18171814
}
18181815
case 'R': {

0 commit comments

Comments
 (0)