Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix trailing slashes when the rest_server_uri is not a string (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyione committed Jul 16, 2020
1 parent c2318c3 commit bb0f912
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/v2/clients/baseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export class OpenPAIBaseClient {
constructor(cluster: IPAICluster) {
this.cluster = OpenPAIBaseClient.parsePaiUri(cluster);
this.httpClient = new PAIHttpClient(cluster);

if (this.cluster.rest_server_uri) {
this.cluster.rest_server_uri = this.cluster.rest_server_uri
.toString()
.replace(/\/+$/, '');
}
}

/**
Expand All @@ -48,8 +54,6 @@ export class OpenPAIBaseClient {
if (!cluster.alias) {
cluster.alias = paiUri.hostname;
}

cluster.rest_server_uri = cluster.rest_server_uri.replace(/\/+$/, '');
}
return cluster;
}
Expand Down

0 comments on commit bb0f912

Please sign in to comment.