Skip to content

Commit

Permalink
🔇 Silence discoverer logs for data-urls
Browse files Browse the repository at this point in the history
These URLs are usually pretty lengthy and can make it difficult to parse logs. These URLs can be
unhandled since we do not care about capturing them and they cannot be aborted.
  • Loading branch information
wwilsman committed Aug 20, 2020
1 parent 6f24fc7 commit 26c4a46
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/discoverer.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ export default class PercyDiscoverer {
return request => {
let url = request.url();

// skip any logging and handling of data-urls
if (url.startsWith('data:')) {
return request.continue();
}

meta = { ...meta, url };
log.debug(`Handling request for ${url}`, meta);
onRequest();
Expand Down Expand Up @@ -197,9 +202,7 @@ export default class PercyDiscoverer {
meta = { ...meta, url };

try {
// do nothing for the root URL or URLs that start with `data:` since
// Puppeteer network interception doesn't support proper request
// aborting for those URLs
// do nothing for the root URL or URLs that start with `data:`
if (url === rootUrl || url.startsWith('data:')) return;

// process and cache the response and resource
Expand Down

0 comments on commit 26c4a46

Please sign in to comment.