fix breakage due to URI.js upgrade

This commit is contained in:
Florian Dold 2019-11-21 11:52:26 +01:00
parent 5b43bd857c
commit 61558e00ae
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -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();