Skip to content

Commit a174da6

Browse files
committed
Version 0.0.40
1 parent 858ced6 commit a174da6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@icepanel/sdk",
3-
"version": "0.0.39",
3+
"version": "0.0.40",
44
"private": false,
55
"repository": {
66
"type": "git",

src/IcePanelClient.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ export class IcePanelClient extends Client {
2222
updatedOptions.baseUrl = async () => {
2323
const baseUrl = options.baseUrl ? await core.Supplier.get(options.baseUrl) : undefined
2424
if (baseUrl) {
25-
return `https://${baseUrl}/${options.apiVersion}`
25+
const url = new URL(baseUrl)
26+
url.pathname = `/${options.apiVersion}`
27+
return url.toString()
2628
}
2729
const environment = options.environment ? await core.Supplier.get(options.environment) : undefined
2830
if (environment) {
29-
return `https://api.${environment}.icepanel.cloud/${options.apiVersion}`
31+
const url = new URL(`https://api.${environment}.icepanel.cloud`)
32+
url.pathname = `/${options.apiVersion}`
33+
return url.toString()
3034
}
31-
return `https://api.icepanel.io/${options.apiVersion}`
35+
const url = new URL(`https://api.icepanel.io`)
36+
url.pathname = `/${options.apiVersion}`
37+
return url.toString()
3238
}
3339

3440
if (options.apiKey) {

0 commit comments

Comments
 (0)