Skip to content

Commit

Permalink
chore: store etag in a json file
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 19, 2024
1 parent d3a9423 commit fe48bb1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/is-node-vulnerable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function loadETag () {
for (const [key, obj] of Object.entries(STORE)) {
if (fs.existsSync(obj.etagFile)) {
debug(`Loading local ETag for '${key}'`)
obj.etagValue = fs.readFileSync(obj.etagFile).toString()
obj.etagValue = require(obj.etagFile)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ module.exports = {
security: {
url: 'https://raw.githubusercontent.com/nodejs/security-wg/main/vuln/core/index.json',
jsonFile: path.join(CACHE_DIR, 'security.json'),
etagFile: path.join(CACHE_DIR, 'security.etag'),
etagFile: path.join(CACHE_DIR, 'security.etag.json'),
etagValue: ''
},
schedule: {
url: 'https://raw.githubusercontent.com/nodejs/Release/main/schedule.json',
jsonFile: path.join(CACHE_DIR, 'schedule.json'),
etagFile: path.join(CACHE_DIR, 'schedule.etag'),
etagFile: path.join(CACHE_DIR, 'schedule.etag.json'),
etagValue: ''
}
}

0 comments on commit fe48bb1

Please sign in to comment.