From 3f2495a0ea7c6342bb7f45788c9c3db5fd585e4d Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Thu, 14 Mar 2024 08:14:52 +0000 Subject: [PATCH] fixup: UI_TRAFFIC_STATS --- src/lib/Server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/Server.js b/src/lib/Server.js index bbdf045b..a5fc7520 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -64,9 +64,10 @@ module.exports = class Server { return `"${LANG}"`; })) - .get('/api/ui-traffic-stats', (Util.promisify(async () => { - return UI_TRAFFIC_STATS === 'true'; - })) + .get('/api/ui-traffic-stats', defineEventHandler((event) => { + setHeader(event, 'Content-Type', 'application/json'); + return `"${UI_TRAFFIC_STATS}"`; + }) // Authentication .get('/api/session', defineEventHandler((event) => {