From 02504b995924e29b3749d75775a301763aa903c7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 13 Aug 2019 12:59:34 +0100 Subject: [PATCH] make it work again --- src/components/views/settings/SetIdServer.js | 10 +++++----- src/i18n/strings/en_EN.json | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/views/settings/SetIdServer.js b/src/components/views/settings/SetIdServer.js index a9762b6e50..70140d4b6a 100644 --- a/src/components/views/settings/SetIdServer.js +++ b/src/components/views/settings/SetIdServer.js @@ -58,11 +58,11 @@ function unabbreviateUrl(u) { /** * Check an IS URL is valid, including liveness check * - * @param {string} isUrl The url to check + * @param {string} u The url to check * @returns {string} null if url passes all checks, otherwise i18ned error string */ -async function checkIdentityServerUrl(url) { - const parsedUrl = url.parse(isUrl); +async function checkIdentityServerUrl(u) { + const parsedUrl = url.parse(u); if (parsedUrl.protocol !== 'https:') return _t("Identity Server URL must be HTTPS"); @@ -73,7 +73,7 @@ async function checkIdentityServerUrl(url) { // also XXX: we don't really know whether to hit /v1 or /v2 for this: we // probably want a /versions endpoint like the C/S API. // https://github.com/matrix-org/matrix-doc/issues/1665 - { method: "GET", url: isUrl + '/_matrix/identity/api/v1' }, + { method: "GET", url: u + '/_matrix/identity/api/v1' }, (err, response, body) => { if (err) { resolve(_t("Could not connect to Identity Server")); @@ -133,7 +133,7 @@ export default class SetIdServer extends React.Component { const fullUrl = unabbreviateUrl(this.state.idServer); - const errStr = await checkIsUrl(fullUrl); + const errStr = await checkIdentityServerUrl(fullUrl); let newFormValue = this.state.idServer; if (!errStr) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 154871a977..5576ee6122 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -540,13 +540,13 @@ "Display Name": "Display Name", "Save": "Save", "Identity Server URL must be HTTPS": "Identity Server URL must be HTTPS", - "Could not connect to ID Server": "Could not connect to ID Server", - "Not a valid ID Server (status code %(code)s)": "Not a valid ID Server (status code %(code)s)", - "Checking Server": "Checking Server", + "Could not connect to Identity Server": "Could not connect to Identity Server", + "Not a valid Identity Server (status code %(code)s)": "Not a valid Identity Server (status code %(code)s)", + "Checking server": "Checking server", "Identity Server (%(server)s)": "Identity Server (%(server)s)", "You are currently using to discover and be discoverable by existing contacts you know. You can change your identity server below.": "You are currently using to discover and be discoverable by existing contacts you know. You can change your identity server below.", "Identity Server": "Identity Server", - "You are not currently using an Identity Server. To discover and be discoverable by existing contacts you know, add one below": "You are not currently using an Identity Server. To discover and be discoverable by existing contacts you know, add one below", + "You are not currently using an identity server. To discover and be discoverable by existing contacts you know, add one below.": "You are not currently using an identity server. To discover and be discoverable by existing contacts you know, add one below.", "Change": "Change", "Flair": "Flair", "Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?",