aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-11-21 11:52:26 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-11-21 11:52:26 +0100
commit61558e00ae6ad9df601a284d99d4806002a35dad (patch)
tree0b15f097810671e6262d47398d82081259d2e3b7
parent5b43bd857c6eb623ff93468046d8bc08226d9ca0 (diff)
downloadwallet-core-61558e00ae6ad9df601a284d99d4806002a35dad.tar.xz
fix breakage due to URI.js upgrade
-rw-r--r--src/helpers.ts6
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();