Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Apr 29, 2021
1 parent 78a0642 commit 222cb22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ async function ensureDownloaded(browsers: BrowserDownload[], logger: GenericLeve
try {
const downloadedChecksum = await download(url, path, logger);
if (downloadedChecksum !== archiveChecksum) {
invalidChecksums.push(
`${url} => ${path} [${downloadedChecksum} vs ${archiveChecksum}]`
);
invalidChecksums.push(`${url} => ${path}`);
}
} catch (err) {
const message = new Error(`Failed to download ${url}`);
Expand All @@ -69,6 +67,7 @@ async function ensureDownloaded(browsers: BrowserDownload[], logger: GenericLeve
)}`
);
logger.error(err);
throw err;
}
})
);
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugins/reporting/server/browsers/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export function installBrowser(

await del(chromiumPath);
await extract(archive, chromiumPath);

const reCheck = await md5(binaryChecksum);
if (reCheck !== pkg.binaryChecksum) {
throw new Error(`Extracted browser checksum is incorrect!`);
}
}

logger.debug(`Browser executable: ${binaryPath}`);
Expand Down

0 comments on commit 222cb22

Please sign in to comment.