Skip to content

Commit

Permalink
Fix getWellKnownUrl()
Browse files Browse the repository at this point in the history
Change-Id: I494831a7608e80c4d9fa1a2455755d915607a22d
  • Loading branch information
awesome-manuel committed Jul 9, 2024
1 parent fce6e03 commit 4adf2c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/synapse/synapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 4adf2c2

Please sign in to comment.