diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-11-21 11:52:26 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-11-21 11:52:26 +0100 |
commit | 61558e00ae6ad9df601a284d99d4806002a35dad (patch) | |
tree | 0b15f097810671e6262d47398d82081259d2e3b7 /src | |
parent | 5b43bd857c6eb623ff93468046d8bc08226d9ca0 (diff) |
fix breakage due to URI.js upgrade
Diffstat (limited to 'src')
-rw-r--r-- | src/helpers.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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(); |