From c0cafd33fa8fe0fcb4b07df60f69e6d7a5cf46e5 Mon Sep 17 00:00:00 2001 From: rishigupta1599 <114384996+rishigupta1599@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:10:03 +0530 Subject: [PATCH] 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 --- packages/core/src/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/network.js b/packages/core/src/network.js index cd7b22f3c..ccdfb059e 100644 --- a/packages/core/src/network.js +++ b/packages/core/src/network.js @@ -3,7 +3,7 @@ import logger from '@percy/logger'; import mime from 'mime-types'; import { DefaultMap, createResource, hostnameMatches, normalizeURL, waitFor, decodeAndEncodeURLWithLogging } from './utils.js'; -const MAX_RESOURCE_SIZE = 25 * (1024 ** 2); // 25MB +const MAX_RESOURCE_SIZE = 25 * (1024 ** 2) * 0.63; // 25MB, 0.63 factor for accounting for base64 encoding const ALLOWED_STATUSES = [200, 201, 301, 302, 304, 307, 308]; const ALLOWED_RESOURCES = ['Document', 'Stylesheet', 'Image', 'Media', 'Font', 'Other']; const ABORTED_MESSAGE = 'Request was aborted by browser';