From a70fc840dca081407c8412d988cd7d889a54a617 Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 16 May 2024 10:19:07 +0600 Subject: [PATCH] api: remove onDemand mention and slight clean up --- src/core/api.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/api.js b/src/core/api.js index 070ff3d6..24b935fd 100644 --- a/src/core/api.js +++ b/src/core/api.js @@ -58,17 +58,19 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) { app.use('/api/json', apiLimiter); app.use('/api/stream', apiLimiterStream); - app.use('/api/onDemand', apiLimiter); app.use((req, res, next) => { - try { decodeURIComponent(req.path) } catch (e) { return res.redirect('/') } + try { + decodeURIComponent(req.path) + } catch { + return res.redirect('/') + } next(); }) app.use('/api/json', express.json({ verify: (req, res, buf) => { - const acceptHeader = String(req.header('Accept')) === "application/json"; - if (acceptHeader) { + if (String(req.header('Accept')) === "application/json") { if (buf.length > 720) throw new Error(); JSON.parse(buf); } else {