From 832566cc0072c770a06c1fad0ce6b6d7bcd28ec4 Mon Sep 17 00:00:00 2001 From: tycrek Date: Sun, 27 Jun 2021 16:27:28 -0600 Subject: [PATCH] DS fixes once again --- ass.js | 14 +++++--------- utils.js | 6 +++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ass.js b/ass.js index 731a6cc..e3a0116 100755 --- a/ass.js +++ b/ass.js @@ -14,7 +14,6 @@ const fs = require('fs-extra'); const express = require('express'); const helmet = require("helmet"); const escape = require('escape-html'); -const useragent = require('express-useragent'); const rateLimit = require("express-rate-limit"); const fetch = require('node-fetch'); const marked = require('marked'); @@ -82,9 +81,6 @@ function startup() { app.set('trust proxy', isProxied); app.set('view engine', 'pug'); - // Express middleware - app.use(useragent.express()); - // Helmet security middleware app.use(helmet.noSniff()); app.use(helmet.ieNoOpen()); @@ -243,11 +239,11 @@ function startup() { // Build OpenGraph meta tags const og = fileData.opengraph, ogs = ['']; - og.title && (ogs.push(``)); - og.description && (ogs.push(``)); - og.author && (ogs.push(``)); - og.color && (ogs.push(``)); - !isVideo && (ogs.push(``)); + og.title && (ogs.push(``)); // skipcq: JS-0093 + og.description && (ogs.push(``)); // skipcq: JS-0093 + og.author && (ogs.push(``)); // skipcq: JS-0093 + og.color && (ogs.push(``)); // skipcq: JS-0093 + !isVideo && (ogs.push(``)); // skipcq: JS-0093 // Send the view to the client res.render('view', { diff --git a/utils.js b/utils.js index d9ecd10..b601ca4 100755 --- a/utils.js +++ b/utils.js @@ -57,9 +57,9 @@ function formatBytes(bytes, decimals = 2) { // skipcq: JS-0074 function replaceholder(data, { size, timestamp, originalname }) { return data - .replace(new RegExp('&size', 'g'), formatBytes(size)) - .replace(new RegExp('&filename', 'g'), originalname) - .replace(new RegExp('×tamp', 'g'), formatTimestamp(timestamp)); + .replace(/&size/g, formatBytes(size)) + .replace(/&filename/g, originalname) + .replace(/×tamp/g, formatTimestamp(timestamp)); } const idModes = {