Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
added trap in resolveUrl for absolute baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Miles committed Aug 22, 2013
1 parent 895bfb2 commit 830760c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/HTMLImports.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ var path = {
// take only the left side if there is a #
return url.split('#')[0];
},
resolveUrl: function(inBaseUrl, inUrl, inRelativeToDocument) {
if (this.isAbsUrl(inUrl)) {
return inUrl;
resolveUrl: function(baseUrl, url, relativeToDocument) {
if (this.isAbsUrl(url)) {
return url;
}
var url = this.compressUrl(this.urlToPath(inBaseUrl) + inUrl);
if (inRelativeToDocument) {
url = this.compressUrl(this.urlToPath(baseUrl) + url);
if (relativeToDocument && !this.isAbsUrl(url)) {
url = path.makeRelPath(path.getDocumentUrl(document), url);
}
return url;
Expand All @@ -305,7 +305,7 @@ var path = {
compressUrl: function(inUrl) {
var url = inUrl, search = '';
var searchPos = url.indexOf('?');
// query string should not cound in path compression
// query string is not part of the path
if (searchPos > -1) {
search = url.substring(searchPos);
url = url.substring(searchPos, 0);
Expand Down

0 comments on commit 830760c

Please sign in to comment.