Skip to content

Commit

Permalink
Accounting base64 encoding for resources size validation (#1803)
Browse files Browse the repository at this point in the history
* Fixing logic of resources with size > 25MB not skipping

* removing pako gzip in client

* lint fix

* Making 0.67 factor

* changing factor

* changing comment
  • Loading branch information
rishigupta1599 authored Nov 28, 2024
1 parent c3490c8 commit c0cafd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit c0cafd3

Please sign in to comment.