diff --git a/node_modules/c9/urls.js b/node_modules/c9/urls.js index 0284030c..f93d4468 100644 --- a/node_modules/c9/urls.js +++ b/node_modules/c9/urls.js @@ -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(/\/$/, ""); }