kopia lustrzana https://github.com/c9/core
Merge pull request +10714 from c9/fix-issue-10369
fixes +10369 silence the warningspull/223/head
commit
e806edd448
|
@ -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(/\/$/, "");
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue