Allow well-known to fail, it is optional after all
This commit is contained in:
parent
2acec4f124
commit
5c2f2b0684
@ -24,6 +24,7 @@ export async function resolveServer(request, baseURL) {
|
||||
baseURL = `https://${baseURL}`;
|
||||
}
|
||||
{
|
||||
try {
|
||||
const {status, body} = await request(`${baseURL}/.well-known/matrix/client`, {method: "GET"}).response();
|
||||
if (status === 200) {
|
||||
const proposedBaseURL = body?.['m.homeserver']?.base_url;
|
||||
@ -31,6 +32,9 @@ export async function resolveServer(request, baseURL) {
|
||||
baseURL = noTrailingSlash(proposedBaseURL);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Failed to fetch ${baseURL}/.well-known/matrix/client", e);
|
||||
}
|
||||
}
|
||||
{
|
||||
const {status} = await request(`${baseURL}/_matrix/client/versions`, {method: "GET"}).response();
|
||||
|
Loading…
Reference in New Issue
Block a user