From acdaac526d0a8bf25883b4dfae737e4ac7a7a3bb Mon Sep 17 00:00:00 2001 From: Miate <61664394+MiateOfficial@users.noreply.github.com> Date: Mon, 22 May 2023 14:52:30 -0700 Subject: [PATCH] Added checksum for library download operation (#110) --- components/handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/handler.js b/components/handler.js index 796df17..faff372 100644 --- a/components/handler.js +++ b/components/handler.js @@ -509,7 +509,7 @@ class Handler { jarPath = path.join(directory, `${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}`) } - if (!fs.existsSync(path.join(jarPath, name))) { + if (!fs.existsSync(path.join(jarPath, name)) || !this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))) { // Simple lib support, forgot which addon needed this but here you go, Mr special. if (library.url) { const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`