From 61558e00ae6ad9df601a284d99d4806002a35dad Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 21 Nov 2019 11:52:26 +0100 Subject: fix breakage due to URI.js upgrade --- src/helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helpers.ts') diff --git a/src/helpers.ts b/src/helpers.ts index a063db169..cfebf394f 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -44,10 +44,10 @@ export function amountToPretty(amount: AmountJson): string { * See http://api.taler.net/wallet.html#general */ export function canonicalizeBaseUrl(url: string) { - const x = new URI(url); - if (!x.protocol()) { - x.protocol("https"); + if (!url.startsWith("http") && !url.startsWith("https")) { + url = "https://" + url; } + const x = new URI(url); x.path(x.path() + "/").normalizePath(); x.fragment(""); x.query(); -- cgit v1.2.3