From 5572b4f10118bb8d13d2e8281c7bef84a81bb730 Mon Sep 17 00:00:00 2001 From: Matthijs van Henten Date: Mon, 23 Nov 2015 16:19:46 +0000 Subject: [PATCH] fixes +10369 silence the warnings --- node_modules/c9/urls.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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(/\/$/, ""); }