mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Merge branch 'main' into feature/pypi
This commit is contained in:
commit
d789491561
26 changed files with 186 additions and 118 deletions
|
|
@ -91,10 +91,19 @@ async function getMalwareDatabase() {
|
|||
}
|
||||
|
||||
const { malwareDatabase, version } = await fetchMalwareDatabase();
|
||||
// @ts-expect-error version can be undefined
|
||||
writeDatabaseToLocalCache(malwareDatabase, version);
|
||||
|
||||
return malwareDatabase;
|
||||
if (version) {
|
||||
// Only cache the malware database when we have a version.
|
||||
writeDatabaseToLocalCache(malwareDatabase, version);
|
||||
return malwareDatabase;
|
||||
} else {
|
||||
// We received a valid malware database, but the response
|
||||
// did not contain an etag header with the version
|
||||
ui.writeWarning(
|
||||
"The malware database was downloaded, but could not be cached due to a missing version."
|
||||
);
|
||||
return malwareDatabase;
|
||||
}
|
||||
} catch (/** @type any */ error) {
|
||||
if (cachedDatabase) {
|
||||
ui.writeWarning(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue