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
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ export function authorizedExtensions() {
export function uploadLocation(url) { export function uploadLocation(url) {
if (Discourse.CDN) { if (Discourse.CDN) {
url = Discourse.getURLWithCDN(url); url = Discourse.getURLWithCDN(url);
return url.startsWith('//') ? 'http:' + url : url; return /^\/\//.test(url) ? 'http:' + url : url;
} else if (Discourse.SiteSettings.enable_s3_uploads) { } else if (Discourse.SiteSettings.enable_s3_uploads) {
return 'https:' + url; return 'https:' + url;
} else { } else {