Remove url
npm dependency and use Web URL constructor (#10930)
This commit is contained in:
parent
7917d973e7
commit
2da199c41d
13 changed files with 101 additions and 53 deletions
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import url from "url";
|
||||
import React, { ReactNode } from "react";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { IThreepid } from "matrix-js-sdk/src/@types/threepids";
|
||||
|
@ -25,7 +24,7 @@ import Modal from "../../../Modal";
|
|||
import dis from "../../../dispatcher/dispatcher";
|
||||
import { getThreepidsWithBindStatus } from "../../../boundThreepids";
|
||||
import IdentityAuthClient from "../../../IdentityAuthClient";
|
||||
import { abbreviateUrl, unabbreviateUrl } from "../../../utils/UrlUtils";
|
||||
import { abbreviateUrl, parseUrl, unabbreviateUrl } from "../../../utils/UrlUtils";
|
||||
import { getDefaultIdentityServerUrl, doesIdentityServerHaveTerms } from "../../../utils/IdentityServerUtils";
|
||||
import { timeout } from "../../../utils/promise";
|
||||
import { ActionPayload } from "../../../dispatcher/payloads";
|
||||
|
@ -44,7 +43,7 @@ const REACHABILITY_TIMEOUT = 10000; // ms
|
|||
* @returns {string} null if url passes all checks, otherwise i18ned error string
|
||||
*/
|
||||
async function checkIdentityServerUrl(u: string): Promise<string | null> {
|
||||
const parsedUrl = url.parse(u);
|
||||
const parsedUrl = parseUrl(u);
|
||||
|
||||
if (parsedUrl.protocol !== "https:") return _t("Identity server URL must be HTTPS");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue