FIX: use CDN for user avatars (take 2)

This commit is contained in:
Régis Hanol
2015-07-15 19:24:23 +02:00
parent 23dadfc06e
commit 25a1bf421e
3 changed files with 4 additions and 6 deletions

View File

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