Merge pull request +10714 from c9/fix-issue-10369

fixes +10369 silence the warnings
pull/223/head
Matthijs van Henten 2015-11-24 09:15:40 +01:00
commit e806edd448
1 zmienionych plików z 4 dodań i 6 usunięć

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

@ -73,6 +73,9 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
if (!sourceBaseUrlPattern)
throw new Error("getBaseUrl() requires at least two arguments");
if (!targetBaseUrlPattern)
targetBaseUrlPattern = sourceBaseUrlPattern;
var sourceHostMatcher = sourceBaseUrlPattern
.replace(/^https?:\/\//, "")
@ -91,15 +94,10 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
targetHost = "c9.io";
}
if (/^(ide|vfs)./.test(targetHost) && !targetBaseUrlPattern)
console.error(new Error("Warning: no targetBaseUrlPattern specified, will stay at " + targetHost), {
sourceBaseUrlPattern: sourceBaseUrlPattern
});
if (/^(ide|vfs)./.test(targetHost))
console.trace("Warning: possibly incorrect baseUrl constructed, with 'ide.' in the hostname: " + targetHost);
return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost)
return replaceDomain(targetBaseUrlPattern, targetHost)
.replace(/\/$/, "");
}