From d38da836568420eb8f2b0b18b160f696aa73edaf Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 4 Jun 2019 23:39:31 -0600 Subject: [PATCH] Provide the discovered URLs when a liveliness error occurs See https://github.com/vector-im/riot-web/issues/9828 --- src/autodiscovery.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/autodiscovery.js b/src/autodiscovery.js index 10f714d2491..e031173fed1 100644 --- a/src/autodiscovery.js +++ b/src/autodiscovery.js @@ -256,6 +256,11 @@ export class AutoDiscovery { if (!hsVersions || !hsVersions.raw["versions"]) { logger.error("Invalid /versions response"); clientConfig["m.homeserver"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER; + + // Supply the base_url to the caller because they may be ignoring liveliness + // errors, like this one. + clientConfig["m.homeserver"].base_url = hsUrl; + return Promise.resolve(clientConfig); } @@ -311,6 +316,11 @@ export class AutoDiscovery { logger.error("Invalid /api/v1 response"); failingClientConfig["m.identity_server"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER; + + // Supply the base_url to the caller because they may be ignoring + // liveliness errors, like this one. + clientConfig["m.identity_server"].base_url = isUrl; + return Promise.resolve(failingClientConfig); } }