From dacb91e81c9b1f48ee386a3a767df69a731ea08f Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 27 Feb 2024 18:00:23 +0100 Subject: [PATCH] New support: fixes --- lib/commands/moderators.js | 5 +++++ lib/http-worker.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/commands/moderators.js b/lib/commands/moderators.js index 60dbb9e33..a77a2c06c 100644 --- a/lib/commands/moderators.js +++ b/lib/commands/moderators.js @@ -11,6 +11,11 @@ const Util = require("../common-util"); Moderators.getAll = (Env, cb) => { Moderator.getAll(Env, (err, data) => { if (err) { return void cb(err); } + let res = {}; + Object.keys(data).forEach(safeKey => { + const unsafeKey = Util.unescapeKeyCharacters(safeKey); + res[unsafeKey] = data[safeKey]; + }); cb(null, data); }); }; diff --git a/lib/http-worker.js b/lib/http-worker.js index 27587ca90..fef492284 100644 --- a/lib/http-worker.js +++ b/lib/http-worker.js @@ -543,7 +543,9 @@ var makeRouteCache = function (template, cacheName) { } // successive calls to this function - cleanUp[cacheKey](); + if (typeof (cleanUp[cacheKey]) === "function") { + cleanUp[cacheKey](); + } return void res.send(cache[cacheKey]); }; };