Skip to content

Commit 7ca3f3e

Browse files
update config, add baseServer property
1 parent 19cb281 commit 7ca3f3e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/connectionConfig.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function ConnectionConfig(serverUrl, params) {
1919
* @type {string}
2020
*/
2121
this.server = undefined;
22+
23+
// the base server url without the team name
24+
this.baseServer = undefined;
2225

2326
// remote auth for authenticating to remote servers for push / fetch / clone
2427
/** @type {typedef.CredentialObj} */
@@ -229,7 +232,9 @@ ConnectionConfig.prototype.parseServerURL = function (str) {
229232

230233
ConnectionConfig.prototype.serverUrlEncoding = function (str) {
231234
const orgArr = str.split('/');
232-
if (orgArr.length > 3) {
235+
if (orgArr.length > 4) {
236+
// we can need only the server baseurl
237+
this.baseServer = str.replace(`${orgArr[3]}/`, '');
233238
// const org = encodeURI(orgArr[3])
234239
/*
235240
* if we pass the organization name like Francesca-Bit-9e73
@@ -239,6 +244,7 @@ ConnectionConfig.prototype.serverUrlEncoding = function (str) {
239244
const org = encodeURISegment(orgArr[3]);
240245
return str.replace(orgArr[3], org);
241246
}
247+
this.baseServer = str;
242248
return str;
243249
};
244250

0 commit comments

Comments
 (0)