.test is more robust them match

pull/223/head
Matthijs van Henten 2015-10-29 20:50:02 +00:00
rodzic 237f0d68ae
commit cf69b96a1a
1 zmienionych plików z 2 dodań i 2 usunięć

4
node_modules/c9/urls.js wygenerowano vendored
Wyświetl plik

@ -91,12 +91,12 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
targetHost = "c9.io"; 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), { console.error(new Error("Warning: no targetBaseUrlPattern specified, will stay at " + targetHost), {
sourceBaseUrlPattern: sourceBaseUrlPattern 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); console.trace("Warning: possibly incorrect baseUrl constructed, with 'ide.' in the hostname: " + targetHost);
return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost) return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost)