mirror of
https://github.com/Awesome-Technologies/synapse-admin.git
synced 2024-10-30 22:45:15 +03:00
Fix getWellKnownUrl()
Change-Id: I494831a7608e80c4d9fa1a2455755d915607a22d
This commit is contained in:
parent
fce6e03fc5
commit
4adf2c2bca
1 changed files with 2 additions and 2 deletions
|
@ -15,8 +15,8 @@ export const isValidBaseUrl = baseUrl => /^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{
|
|||
export const getWellKnownUrl = async domain => {
|
||||
const wellKnownUrl = `https://${domain}/.well-known/matrix/client`;
|
||||
try {
|
||||
const json = await fetchUtils.fetchJson(wellKnownUrl, { method: "GET" });
|
||||
return json["m.homeserver"].base_url;
|
||||
const response = await fetchUtils.fetchJson(wellKnownUrl, { method: "GET" });
|
||||
return response.json["m.homeserver"].base_url;
|
||||
} catch {
|
||||
// if there is no .well-known entry, return the domain itself
|
||||
return `https://${domain}`;
|
||||
|
|
Loading…
Reference in a new issue