From 3372ca195415fa3a0b8ce443a7a6abf8047e8ac3 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Sat, 22 Jan 2022 18:56:33 +0200 Subject: [PATCH] checksum fail message undefined, app.use() duplicate --- api/src/index.js | 1 - api/src/package.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index 025f5ae..79bca00 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -77,7 +77,6 @@ expressWs(app); const api_v2 = require('./api/v2'); app.use('/api/v2', api_v2); - app.use('/api/v2', api_v2); app.use((req, res, next) => { return res.status(404).send({ message: 'Not Found' }); diff --git a/api/src/package.js b/api/src/package.js index 4e4630f..11e4f34 100644 --- a/api/src/package.js +++ b/api/src/package.js @@ -80,7 +80,9 @@ class Package { const cs = hash.digest('hex'); if (cs !== this.checksum) { - throw new Error(`Checksum miss-match want: ${val} got: ${cs}`); + throw new Error( + `Checksum miss-match want: ${this.checksum} got: ${cs}` + ); } logger.debug(