From d5e6c015e1d30f77d3d5149c89b14d1086fad1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elodie=20Thi=C3=A9blin?= Date: Fri, 23 Jul 2021 15:58:32 +0200 Subject: [PATCH] fix: allow remove base on urn uids Create root in the same way prependBase creates a URL --- lib/url.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/url.js b/lib/url.js index 7855f693..eab920f7 100644 --- a/lib/url.js +++ b/lib/url.js @@ -165,7 +165,10 @@ api.removeBase = (base, iri) => { // establish base root let root = ''; if(base.href !== '') { - root += (base.protocol || '') + '//' + (base.authority || ''); + root += base.protocol || ''; + if(base.authority !== null) { + root += '//' + base.authority; + } } else if(iri.indexOf('//')) { // support network-path reference with empty base root += '//';