Merge "Use URL.origin instead of URL.pathname"
This commit is contained in:
commit
49edeea3d0
@ -102,8 +102,7 @@
|
||||
if (!pathOrUrl.startsWith('/')) {
|
||||
pathOrUrl = '/' + pathOrUrl;
|
||||
}
|
||||
const {href, pathname} = window.location;
|
||||
return href.split(pathname)[0] + this.getBaseUrl() + pathOrUrl;
|
||||
return window.location.origin + this.getBaseUrl() + pathOrUrl;
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
@ -43,7 +43,7 @@ limitations under the License.
|
||||
sandbox = sinon.sandbox.create();
|
||||
sandbox.stub(document.body, 'appendChild');
|
||||
sandbox.stub(element, 'importHref');
|
||||
url = window.location.href.split(window.location.pathname)[0];
|
||||
url = window.location.origin;
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user