From 830760cdbb7c0a97fc7c39d6e0f92e6ba817328f Mon Sep 17 00:00:00 2001 From: Scott Miles Date: Thu, 22 Aug 2013 15:36:09 -0700 Subject: [PATCH] added trap in resolveUrl for absolute baseUrl --- src/HTMLImports.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HTMLImports.js b/src/HTMLImports.js index 5849d5f..dc2e8e3 100644 --- a/src/HTMLImports.js +++ b/src/HTMLImports.js @@ -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; @@ -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);