Skip to content

Commit c0cafd3

Browse files
Accounting base64 encoding for resources size validation (#1803)
* Fixing logic of resources with size > 25MB not skipping * removing pako gzip in client * lint fix * Making 0.67 factor * changing factor * changing comment
1 parent c3490c8 commit c0cafd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import logger from '@percy/logger';
33
import mime from 'mime-types';
44
import { DefaultMap, createResource, hostnameMatches, normalizeURL, waitFor, decodeAndEncodeURLWithLogging } from './utils.js';
55

6-
const MAX_RESOURCE_SIZE = 25 * (1024 ** 2); // 25MB
6+
const MAX_RESOURCE_SIZE = 25 * (1024 ** 2) * 0.63; // 25MB, 0.63 factor for accounting for base64 encoding
77
const ALLOWED_STATUSES = [200, 201, 301, 302, 304, 307, 308];
88
const ALLOWED_RESOURCES = ['Document', 'Stylesheet', 'Image', 'Media', 'Font', 'Other'];
99
const ABORTED_MESSAGE = 'Request was aborted by browser';

0 commit comments

Comments
 (0)