diff --git a/src/js/login.js b/src/js/login.js index 52ec151..725ef4e 100644 --- a/src/js/login.js +++ b/src/js/login.js @@ -119,19 +119,20 @@ class Form extends ElemJS { maxDepth-- if(maxDepth<=0) throw new Error(`Failed to look up homeserver, maximum search depth reached`) + //Preprocess the address if (!address.match(/^https?:\/\//)) { console.warn(`${address} doesn't specify the protocol, assuming https`) address = "https://" + address } - address = address.replace(/\/*$/, "") + this.status(`Looking up homeserver... trying ${address}`) - // check if we found the actual matrix server + // Check if we found the actual matrix server try { const versionsReq = await fetch(`${address}/_matrix/client/versions`) if(versionsReq.ok) { - const versions = await versionsReq.json().catch(()=>{}) + const versions = await versionsReq.json() if (Array.isArray(versions.versions)) { return address }