FIX: apply s3 cdn to client side assets

This commit is contained in:
Sam
2015-05-27 12:59:51 +10:00
parent a988cd5abe
commit 24102f2636
2 changed files with 12 additions and 1 deletions

View File

@ -32,7 +32,12 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
getURLWithCDN: function(url) {
url = this.getURL(url);
if (Discourse.CDN) { url = Discourse.CDN + url; }
// https:// and http:// and // should be skipped, only /xyz is allowed here
if (Discourse.CDN && url[1] !== "/") {
url = Discourse.CDN + url;
} else if (Discourse.S3CDN) {
url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN);
}
return url;
},