diff --git a/app/assets/javascripts/discourse/lib/utilities.js.es6 b/app/assets/javascripts/discourse/lib/utilities.js.es6 index 82e3cd94e..6dc7b93ec 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js.es6 +++ b/app/assets/javascripts/discourse/lib/utilities.js.es6 @@ -226,7 +226,7 @@ export function authorizedExtensions() { export function uploadLocation(url) { if (Discourse.CDN) { url = Discourse.getURLWithCDN(url); - return url.startsWith('//') ? 'http:' + url : url; + return /^\/\//.test(url) ? 'http:' + url : url; } else if (Discourse.SiteSettings.enable_s3_uploads) { return 'https:' + url; } else {