From cf69b96a1aac9fb45c1e4412cf7bc3203d25f2dd Mon Sep 17 00:00:00 2001 From: Matthijs van Henten Date: Thu, 29 Oct 2015 20:50:02 +0000 Subject: [PATCH] .test is more robust them match --- node_modules/c9/urls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/c9/urls.js b/node_modules/c9/urls.js index c48a3cff..0284030c 100644 --- a/node_modules/c9/urls.js +++ b/node_modules/c9/urls.js @@ -91,12 +91,12 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) { targetHost = "c9.io"; } - if (targetHost.match(/^(ide|vfs)./) && !targetBaseUrlPattern) + if (/^(ide|vfs)./.test(targetHost) && !targetBaseUrlPattern) console.error(new Error("Warning: no targetBaseUrlPattern specified, will stay at " + targetHost), { sourceBaseUrlPattern: sourceBaseUrlPattern }); - if (targetHost.match(/^(ide|vfs)./)) + if (/^(ide|vfs)./.test(targetHost)) console.trace("Warning: possibly incorrect baseUrl constructed, with 'ide.' in the hostname: " + targetHost); return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost)