oops
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bad 2020-10-21 21:16:45 +02:00
parent 6f67ddbce5
commit 0c3c06bc0a

View file

@ -128,13 +128,15 @@ class Form extends ElemJS {
this.status(`Looking up homeserver... trying ${address}`) this.status(`Looking up homeserver... trying ${address}`)
// check if we found the actual matrix server // check if we found the actual matrix server
const versionsReq = await fetch(`${address}/_matrix/client/versions`).catch(()=>{}); try {
if(versionsReq?.ok) { const versionsReq = await fetch(`${address}/_matrix/client/versions`)
if(versionsReq.ok) {
const versions = await versionsReq.json().catch(()=>{}) const versions = await versionsReq.json().catch(()=>{})
if (Array.isArray(versions.versions)) { if (Array.isArray(versions.versions)) {
return address return address
} }
} }
} catch(e) {}
// find the next matrix server in the chain // find the next matrix server in the chain
const root = await fetch(`${address}/.well-known/matrix/client`).then(res => res.json()).catch(e => { const root = await fetch(`${address}/.well-known/matrix/client`).then(res => res.json()).catch(e => {