.test is more robust them match

This commit is contained in:
Matthijs van Henten 2015-10-29 20:50:02 +00:00
parent 237f0d68ae
commit cf69b96a1a

4
node_modules/c9/urls.js generated vendored
View File

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