From 35a51107b76b9818b65463546a0090b38cf19f1d Mon Sep 17 00:00:00 2001 From: tycrek Date: Fri, 30 Jul 2021 11:10:04 -0600 Subject: [PATCH] now uses my NoFavicon middleware --- ass.js | 5 +++-- package.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ass.js b/ass.js index 579479d..5ec5246 100755 --- a/ass.js +++ b/ass.js @@ -18,6 +18,7 @@ const { host, port, useSsl, isProxied, s3enabled } = require('./config.json'); //#region Imports const fs = require('fs-extra'); const express = require('express'); +const nofavicon = require('@tycrek/express-nofavicon'); const helmet = require('helmet'); const marked = require('marked'); const uploadRouter = require('./routers/upload'); @@ -65,8 +66,8 @@ app.use(helmet.referrerPolicy()); app.use(helmet.dnsPrefetchControl()); useSsl && app.use(helmet.hsts({ preload: true })); // skipcq: JS-0093 -// Don't process favicon requests (custom middleware) -app.use((req, res, next) => (req.url.includes('favicon.ico') ? res.sendStatus(CODE_NO_CONTENT) : next())); +// Don't process favicon requests +app.use(nofavicon); // Index can be overridden by a frontend app.get('/', (req, res, next) => diff --git a/package.json b/package.json index 44aa190..e1a3f64 100755 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ }, "dependencies": { "@tycrek/ass-storage-engine": "0.2.7", + "@tycrek/express-nofavicon": "^1.0.2", "@tycrek/log": ">=0.5.x", "any-shell-escape": "^0.1.1", "aws-sdk": "^2.930.0",