Skip to content

Commit

Permalink
Fixed issue, using location.href resulted in possible unwanted mixin …
Browse files Browse the repository at this point in the history
…with query string and get parameters when solving AMD autoload module URL
  • Loading branch information
genius257 committed Sep 3, 2022
1 parent 916a25a commit 110c114
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/js/AMD/autoload.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
try {
new URL(url);
} catch (e) {
url = new URL(url, window.location.href).href; //FIXME: we should not use window.location.href, but only protocol, hostname and path. Query string and get parameters should be ignored.
var location = window.location;
url = new URL(url, `${location.protocol}//${location.hostname}${location.pathname}`).href;
}
var url = new URL(dependency, url).href;//requires us to know the url we base this call on.
const fileName = url.split('/').pop();
Expand Down

0 comments on commit 110c114

Please sign in to comment.