Merge pull request #4279 from scossar/s3cdn-upload-location

FIX: get urlWithCDN before appending protocol
This commit is contained in:
Sam 2016-06-29 12:18:44 +10:00 committed by GitHub
commit 7a4c3af29d

View file

@ -251,7 +251,8 @@ Discourse.Utilities = {
uploadLocation: function(url) {
if (Discourse.CDN) {
return Discourse.CDN.startsWith('//') ? "http:" + Discourse.getURLWithCDN(url) : Discourse.getURLWithCDN(url);
url = Discourse.getURLWithCDN(url);
return url.startsWith('//') ? 'http:' + url : url;
} else if (Discourse.SiteSettings.enable_s3_uploads) {
return 'https:' + url;
} else {