kopia lustrzana https://github.com/c9/core
.test is more robust them match
rodzic
237f0d68ae
commit
cf69b96a1a
|
@ -91,12 +91,12 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
|
|||
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), {
|
||||
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);
|
||||
|
||||
return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost)
|
||||
|
|
Ładowanie…
Reference in New Issue