FIX: use CDN URL for audio/video uploads

This commit is contained in:
Arpit Jalan 2016-01-14 17:43:27 +05:30
parent ffb24bf82d
commit d2c297955a
1 changed files with 1 additions and 1 deletions

View File

@ -262,7 +262,7 @@ Discourse.Utilities = {
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
} else if (!Discourse.SiteSettings.prevent_anons_from_downloading_files && (/\.(mov|mp4|webm|ogv|mp3|ogg|wav)$/i).test(upload.original_filename)) {
// is Audio/Video
return "http://" + Discourse.BaseUrl + upload.url;
return Discourse.CDN ? Discourse.getURLWithCDN(upload.url) : "http://" + Discourse.BaseUrl + upload.url;
} else {
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')';
}