Skip to content

Commit

Permalink
Fixed ignoreSameOriginRequest mismatch between css and assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
keithclark committed Jun 16, 2011
1 parent 9e6fffc commit b2bca1a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions selectivizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,14 @@ References:
contextUrl = baseUrl;
}

// absolute path
if (/^https?:\/\//i.test(url)) {
return !ignoreSameOriginPolicy || getProtocolAndHost(contextUrl) == getProtocolAndHost(url) ? url : null;
}

// protocol-relative path
if (url.substring(0,2)=="//") {
return getProtocol(contextUrl) + url;
url = getProtocol(contextUrl) + url;
}

// absolute path
if (/^https?:\/\//i.test(url)) {
return !ignoreSameOriginPolicy && getProtocolAndHost(contextUrl) != getProtocolAndHost(url) ? null : url ;
}

// root-relative path
Expand All @@ -443,12 +443,12 @@ References:
if (url) {
return loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING).
replace(RE_IMPORT, function( match, quoteChar, importUrl, quoteChar2, importUrl2, media ) {
var cssText = parseStyleSheet(resolveUrl(importUrl || importUrl2, url, true));
var cssText = parseStyleSheet(resolveUrl(importUrl || importUrl2, url));
return (media) ? "@media " + media + " {" + cssText + "}" : cssText;
}).
replace(RE_ASSET_URL, function( match, quoteChar, assetUrl ) {
quoteChar = quoteChar || EMPTY_STRING;
return " url(" + quoteChar + resolveUrl(assetUrl, url) + quoteChar + ") ";
return " url(" + quoteChar + resolveUrl(assetUrl, url, true) + quoteChar + ") ";
});
}
return EMPTY_STRING;
Expand Down

0 comments on commit b2bca1a

Please sign in to comment.