mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Retry downloading the malware database 3 times
This commit is contained in:
parent
7377b5577a
commit
14e94dcb62
2 changed files with 77 additions and 34 deletions
|
|
@ -48,13 +48,13 @@ export async function openMalwareDatabase() {
|
|||
*/
|
||||
function getPackageStatus(name, version) {
|
||||
const normalizedName = normalizePackageName(name);
|
||||
const packageData = malwareDatabase.find(
|
||||
(pkg) => {
|
||||
const normalizedPkgName = normalizePackageName(pkg.package_name);
|
||||
return normalizedPkgName === normalizedName &&
|
||||
(pkg.version === version || pkg.version === "*");
|
||||
}
|
||||
);
|
||||
const packageData = malwareDatabase.find((pkg) => {
|
||||
const normalizedPkgName = normalizePackageName(pkg.package_name);
|
||||
return (
|
||||
normalizedPkgName === normalizedName &&
|
||||
(pkg.version === version || pkg.version === "*")
|
||||
);
|
||||
});
|
||||
|
||||
if (!packageData) {
|
||||
return MALWARE_STATUS_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue