Skip to content

Commit c0d2eea

Browse files
committed
fix(client): createClient doesn't copy all settings of client
Signed-off-by: Alexandre Philibeaux <[email protected]>
1 parent 2e2d4fb commit c0d2eea

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/clients/src/scw/client.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { getLogger } from '../internal/logger'
22
import type { ClientConfig } from './client-ini-factory'
3-
import { withLegacyInterceptors, withProfile } from './client-ini-factory'
4-
import type { Profile } from './client-ini-profile'
3+
import {
4+
withAdditionalInterceptors,
5+
withLegacyInterceptors,
6+
withProfile,
7+
} from './client-ini-factory'
58
import type { Settings } from './client-settings'
69
import { assertValidSettings } from './client-settings'
710
import { userAgent, version } from './constants'
@@ -99,5 +102,8 @@ export const createAdvancedClient = (...configs: ClientConfig[]): Client => {
99102
*
100103
* @public
101104
*/
102-
export const createClient = (profile: Profile = {}): Client =>
103-
createAdvancedClient(withProfile(profile))
105+
export const createClient = (settings: Partial<Settings>): Client =>
106+
createAdvancedClient(
107+
withProfile(settings),
108+
withAdditionalInterceptors(settings.interceptors ?? []),
109+
)

0 commit comments

Comments
 (0)