Merge pull request +10161 from c9/improve-urls

[Trivial] .test is more robust them match
This commit is contained in:
Lennart Kats 2015-10-30 09:34:24 +01:00
commit 93e50f59e2

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)