linkPreviewFetch: Increase maximum HTML we'll process to 1000*1024 bytes

This commit is contained in:
Scott Nonnenberg 2021-10-14 11:53:53 -07:00 committed by GitHub
parent fe98f90d70
commit da9df293c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -843,7 +843,7 @@ describe('link preview fetching', () => {
sinon.assert.notCalled(shouldNeverBeCalled);
});
it('stops reading bodies after 500 kilobytes', async function test() {
it('stops reading bodies after 1000 kilobytes', async function test() {
const shouldNeverBeCalled = sinon.stub();
const fakeFetch = stub().resolves(
@ -855,6 +855,9 @@ describe('link preview fetching', () => {
const spaces = new Uint8Array(250 * 1024).fill(32);
yield spaces;
yield spaces;
yield spaces;
yield spaces;
yield spaces;
shouldNeverBeCalled();
yield new TextEncoder().encode(
'<meta property="og:description" content="should be ignored">'