don't use startsWith just yet

This commit is contained in:
Régis Hanol 2016-08-03 14:31:52 +02:00
parent b08ab829b8
commit a21d52951a

View file

@ -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 {