Fix removing trailing slash making JMP unable to connect to some servers

This commit is contained in:
Fred G 2024-09-02 15:35:40 +02:00
parent 86e8b424d6
commit 1d1bb11dd0

View File

@ -5,9 +5,8 @@ async function tryConnect(server) {
if (!server.startsWith("http")) {
server = "http://" + server;
}
server = server.replace(/\/+$/, "");
const url = server + "/System/Info/Public";
serverBaseURL = server.replace(/\/+$/, "");
const url = serverBaseURL + "/System/Info/Public";
const response = await fetch(url);
if (response.ok && (await response.json()).Id) {
const htmlResponse = await fetch(server);