From a21d52951ae949ffda12848491023e4b0209837b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 3 Aug 2016 14:31:52 +0200 Subject: [PATCH] don't use startsWith just yet --- app/assets/javascripts/discourse/lib/utilities.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/utilities.js.es6 b/app/assets/javascripts/discourse/lib/utilities.js.es6 index 82e3cd94eb3..6dc7b93ecb1 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 {