From 26c4a46affd37fa127ccca550f45aab874d203c2 Mon Sep 17 00:00:00 2001 From: Wil Wilsman Date: Thu, 20 Aug 2020 15:21:24 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=87=20Silence=20discoverer=20logs=20fo?= =?UTF-8?q?r=20data-urls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/core/src/discoverer.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/discoverer.js b/packages/core/src/discoverer.js index c3849cb90..5c907b291 100644 --- a/packages/core/src/discoverer.js +++ b/packages/core/src/discoverer.js @@ -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(); @@ -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