mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Write a warning if no version was returned from the malware download, causing the malware db not to be cached.
This commit is contained in:
parent
e79fbded9e
commit
3ea4e82acb
1 changed files with 8 additions and 2 deletions
|
|
@ -75,9 +75,15 @@ async function getMalwareDatabase() {
|
||||||
if (version) {
|
if (version) {
|
||||||
// Only cache the malware database when we have a version.
|
// Only cache the malware database when we have a version.
|
||||||
writeDatabaseToLocalCache(malwareDatabase, version);
|
writeDatabaseToLocalCache(malwareDatabase, version);
|
||||||
}
|
|
||||||
|
|
||||||
return malwareDatabase;
|
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) {
|
} catch (/** @type any */ error) {
|
||||||
if (cachedDatabase) {
|
if (cachedDatabase) {
|
||||||
ui.writeWarning(
|
ui.writeWarning(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue