diff --git a/app/assets/javascripts/discourse.js.es6 b/app/assets/javascripts/discourse.js.es6 index 928457b7518..e66abede413 100644 --- a/app/assets/javascripts/discourse.js.es6 +++ b/app/assets/javascripts/discourse.js.es6 @@ -33,8 +33,8 @@ const Discourse = Ember.Application.extend({ // only relative urls if (Discourse.CDN && /^\/[^\/]/.test(url)) { url = Discourse.CDN + url; - } else if (Discourse.UploadCDN) { - url = url.replace(Discourse.UploadBaseUrl, Discourse.UploadCDN); + } else if (Discourse.S3CDN) { + url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN); } return url; }, diff --git a/app/assets/javascripts/discourse/lib/utilities.js.es6 b/app/assets/javascripts/discourse/lib/utilities.js.es6 index 4a003021f98..be5ef8cd9af 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js.es6 +++ b/app/assets/javascripts/discourse/lib/utilities.js.es6 @@ -428,7 +428,7 @@ export function uploadLocation(url) { if (Discourse.CDN) { url = Discourse.getURLWithCDN(url); return /^\/\//.test(url) ? "http:" + url : url; - } else if (Discourse.UploadBaseUrl) { + } else if (Discourse.S3BaseUrl) { return "https:" + url; } else { var protocol = window.location.protocol + "//", diff --git a/app/views/common/_discourse_javascript.html.erb b/app/views/common/_discourse_javascript.html.erb index 8f6fe767845..150c88f3fea 100644 --- a/app/views/common/_discourse_javascript.html.erb +++ b/app/views/common/_discourse_javascript.html.erb @@ -56,9 +56,9 @@ Discourse.HighlightJSPath = <%= HighlightJs.path.inspect.html_safe %>; <%- if SiteSetting.Upload.enable_s3_uploads %> <%- if SiteSetting.Upload.s3_cdn_url.present? %> - Discourse.UploadCDN = '<%= SiteSetting.Upload.s3_cdn_url %>'; + Discourse.S3CDN = '<%= SiteSetting.Upload.s3_cdn_url %>'; <%- end %> - Discourse.UploadBaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>'; + Discourse.S3BaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>'; <%- end %> })();