From 82736a236c17629500fb3a3c4e472f3481c404c1 Mon Sep 17 00:00:00 2001 From: tycrek Date: Thu, 17 Jun 2021 23:03:08 -0600 Subject: [PATCH] idefk LMAO --- ass.js | 6 +++--- metrics.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ass.js b/ass.js index 38988d5..4320e32 100755 --- a/ass.js +++ b/ass.js @@ -90,14 +90,14 @@ function startup() { // Block unauthorized requests and attempt token sanitization app.post('/', (req, res, next) => { req.token = req.headers.authorization.replace(/[^\da-z]/gi, ''); - !verify(req, users) ? res.sendStatus(401) : next(); + !verify(req, users) ? res.sendStatus(401) : next(); // skipcq: JS-0093 }); // Generate ID's to use for other functions app.post('/', (req, _res, next) => (req.randomId = generateId('random', 32, null, null), next())); app.post('/', (req, _res, next) => (req.deleteId = generateId('random', 32, null, null), next())); - // Upload file (local & S3) + // Upload file (local & S3) // skipcq: JS-0093 s3enabled ? app.post('/', (req, res, next) => uploadS3(req, res, (error) => ((error) && console.error(error), next()))) : app.post('/', uploadLocal, ({ next }) => next()); @@ -220,7 +220,7 @@ function startup() { // Parse the resource ID req.ass = { resourceId: escape(req.params.resourceId).split('.')[0] }; - // If the ID is invalid, return 404. Otherwise, continue normally + // If the ID is invalid, return 404. Otherwise, continue normally // skipcq: JS-0093 (!req.ass.resourceId || !data[req.ass.resourceId]) ? res.sendStatus(404) : next(); }); diff --git a/metrics.js b/metrics.js index 8bdd2a3..60356af 100644 --- a/metrics.js +++ b/metrics.js @@ -13,7 +13,7 @@ module.exports = () => { Object.values(data).forEach(({ token, size }) => { try { totalSize += size; - if (token === undefined) oldSize += size; + if (token === undefined) oldSize += size; // skipcq: JS-0127 else { if (!users[token].size) users[token].size = 0; users[token].size += size;