fix: ensure app load is limited to real asar files when appropriate (#39788)

This commit is contained in:
Samuel Attard 2023-09-11 11:51:14 -07:00 committed by GitHub
parent ac040bf734
commit 16aec702b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

View file

@ -27,7 +27,7 @@ const cachedArchives = new Map<string, NodeJS.AsarArchive>();
const getOrCreateArchive = (archivePath: string) => {
const isCached = cachedArchives.has(archivePath);
if (isCached) {
return cachedArchives.get(archivePath);
return cachedArchives.get(archivePath)!;
}
try {
@ -39,6 +39,8 @@ const getOrCreateArchive = (archivePath: string) => {
}
};
process._getOrCreateArchive = getOrCreateArchive;
const asarRe = /\.asar/i;
const { getValidatedPath } = __non_webpack_require__('internal/fs/utils');