Skip to content

Commit

Permalink
fix: trim trailing slash and build url correctly (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler authored Aug 8, 2023
1 parent 351a805 commit 9bdff5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/sdk/src/clients/lcd-client/lcd-client.abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AbstractKyveLCDClient {
this.restEndpoint = restEndpoint;
this.request = (url: string, params?: Record<string, any>) =>
axios
.get(new URL(url, this.restEndpoint).href, { params })
.get(`${this.restEndpoint}${url}`, { params })
.then((res) => res.data);
}
}
4 changes: 2 additions & 2 deletions common/sdk/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ export class KyveSDK {
}

if (options?.rpc) {
this.config = { ...this.config, rpc: options.rpc };
this.config = { ...this.config, rpc: options.rpc.replace(/\/$/, "") };
}

if (options?.rest) {
this.config = { ...this.config, rest: options.rest };
this.config = { ...this.config, rest: options.rest.replace(/\/$/, "") };
}

if (options?.coin) {
Expand Down

0 comments on commit 9bdff5a

Please sign in to comment.