From 76b88809727f38173cb7893e945d13eb618cb359 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 8 Nov 2023 23:20:55 +0200 Subject: [PATCH] Normalize response statuses --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index e08e52827..0c908e55d 100644 --- a/server.js +++ b/server.js @@ -524,7 +524,7 @@ app.post("/api/textgenerationwebui/status", jsonParser, async function (request, if (!modelsReply.ok) { console.log('Models endpoint is offline.'); - return response.status(modelsReply.status); + return response.status(400); } const data = await modelsReply.json(); @@ -536,7 +536,7 @@ app.post("/api/textgenerationwebui/status", jsonParser, async function (request, if (!Array.isArray(data.data)) { console.log('Models response is not an array.') - return response.status(503); + return response.status(400); } const modelIds = data.data.map(x => x.id);