From a1754c7192ed3ceab97e1161a3def78f4dac1d3d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:32:09 +0200 Subject: [PATCH] Update server.js --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index c00e283a9..66a633130 100644 --- a/server.js +++ b/server.js @@ -25,7 +25,6 @@ const compression = require('compression'); const cookieParser = require('cookie-parser'); const multer = require("multer"); const responseTime = require('response-time'); -const bodyParser = require('body-parser'); // net related library imports const net = require("net"); @@ -107,7 +106,6 @@ process.chdir(directory); const app = express(); app.use(compression()); app.use(responseTime()); -app.use(bodyParser.json()); // impoort from statsHelpers.js @@ -308,6 +306,8 @@ app.use(function (req, res, next) { }); if (getConfigValue('enableCorsProxy', false) === true || cliArguments.corsProxy === true) { + const bodyParser = require('body-parser'); + app.use(bodyParser.json()); console.log('Enabling CORS proxy'); app.use('/proxy/:url(*)', async (req, res) => {