Skip to content

Commit

Permalink
Provide the discovered URLs when a liveliness error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jun 5, 2019
1 parent 1b78856 commit d38da83
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/autodiscovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d38da83

Please sign in to comment.