From f5464fb1af6131ff12cc0044489e1e7e1781f1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 27 Jan 2022 18:46:28 +0100 Subject: [PATCH] Fixing bad return in controller --- pusher/src/Controller/AdminController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pusher/src/Controller/AdminController.ts b/pusher/src/Controller/AdminController.ts index 26556698..6fbf5721 100644 --- a/pusher/src/Controller/AdminController.ts +++ b/pusher/src/Controller/AdminController.ts @@ -32,7 +32,8 @@ export class AdminController extends BaseController { const body = await res.json(); if (ADMIN_API_TOKEN === "") { - return res.writeStatus("401 Unauthorized").end("No token configured!"); + res.writeStatus("401 Unauthorized").end("No token configured!"); + return; } if (token !== ADMIN_API_TOKEN) { console.error("Admin access refused for token: " + token); @@ -82,7 +83,8 @@ export class AdminController extends BaseController { const body = await res.json(); if (ADMIN_API_TOKEN === "") { - return res.writeStatus("401 Unauthorized").end("No token configured!"); + res.writeStatus("401 Unauthorized").end("No token configured!"); + return; } if (token !== ADMIN_API_TOKEN) { console.error("Admin access refused for token: " + token);