diff --git a/Gruntfile.js b/Gruntfile.js index 6a799414..2fdc180b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -762,6 +762,7 @@ module.exports = function (grunt) { }, virustotal: { options: { + prefix: `keeweb.v${pkg.version}-${sha}.`, timeout: 10 * 60 * 1000, get apiKey() { return require('./keys/virus-total.json').apiKey; diff --git a/build/tasks/grunt-virustotal.js b/build/tasks/grunt-virustotal.js index 255f5fa3..94b5af97 100644 --- a/build/tasks/grunt-virustotal.js +++ b/build/tasks/grunt-virustotal.js @@ -21,13 +21,13 @@ module.exports = function (grunt) { const timeStarted = Date.now(); - const { apiKey, timeout = 60 * 1000 } = opt; + const { apiKey, prefix, timeout = 60 * 1000 } = opt; const interval = 5000; const headers = { 'x-apikey': apiKey }; const fileData = fs.readFileSync(file); - const fileName = path.basename(file); + const fileName = (prefix || '') + path.basename(file); const form = new FormData(); form.append('file', fileData, fileName);