From ec43674695a1c26651fb9540f560e7f0e6a7df07 Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Sat, 10 Dec 2022 23:23:26 -0300 Subject: [PATCH] now connection check actually working Signed-off-by: Victor Seiji Hariki --- js/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/index.js b/js/index.js index 13cdb4e..35eb3dc 100644 --- a/js/index.js +++ b/js/index.js @@ -269,8 +269,7 @@ async function testHostConnection() { try { // Check if API is available const response = await fetch( - document.getElementById("host").value + "/sdapi/v1/options", - {method: "OPTIONS"} + document.getElementById("host").value + "/sdapi/v1/options" ); switch (response.status) { case 200: { @@ -295,7 +294,7 @@ async function testHostConnection() { } default: { setConnectionStatus("offline"); - const message = `The host is online, but the API seems to be disabled. Have you run the webui with the flag --api?`; + const message = `The connection with the host returned an error: ${response.status} - ${response.statusText}`; console.error(message); if (notify) alert(message); }