From 4adf2c2bca0c5850eebffbb551866b23ecc14084 Mon Sep 17 00:00:00 2001 From: Manuel Stahl Date: Fri, 26 Apr 2024 14:56:40 +0200 Subject: [PATCH] Fix getWellKnownUrl() Change-Id: I494831a7608e80c4d9fa1a2455755d915607a22d --- src/synapse/synapse.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/synapse/synapse.ts b/src/synapse/synapse.ts index 459d6e4..fc8cc0e 100644 --- a/src/synapse/synapse.ts +++ b/src/synapse/synapse.ts @@ -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}`;