Merge "Use URL.origin instead of URL.pathname"

This commit is contained in:
viktard 2018-05-08 04:13:17 +00:00 committed by Gerrit Code Review
commit 49edeea3d0
2 changed files with 2 additions and 3 deletions

View File

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

View File

@ -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(() => {