Merge pull request #755 from fredguile/fix-754

Fix removing trailing slash making JMP unable to connect to some servers
This commit is contained in:
Izzie Walton 2024-09-20 13:20:49 -04:00 committed by GitHub
commit d0f27ce838
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);