We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34fd9c9 commit a117a1aCopy full SHA for a117a1a
1 file changed
packages/delegation-toolkit/src/experimental/delegationStorage.ts
@@ -53,13 +53,16 @@ export class DelegationStorageClient {
53
#apiUrl: string;
54
55
constructor(config: DelegationStorageConfig) {
56
- let apiUrl = config.environment.apiUrl.replace(/\/+$/u, ''); // Remove trailing slashes
+ const apiUrl = config.environment.apiUrl;
57
+
58
if (!apiUrl.endsWith(this.#apiVersionPrefix)) {
- apiUrl = `${apiUrl}/${this.#apiVersionPrefix}`;
59
+ const separator = apiUrl.endsWith('/') ? '' : '/';
60
+ this.#apiUrl = `${apiUrl}${separator}${this.#apiVersionPrefix}`;
61
+ } else {
62
+ this.#apiUrl = apiUrl;
63
}
64
this.#fetcher = this.#initializeFetcher(config);
65
this.#config = config;
- this.#apiUrl = apiUrl;
66
67
68
/**
0 commit comments