Skip to content

Commit 96cacf4

Browse files
committed
simpleSDK/constructFetcher/add extra.headers
1 parent 652c882 commit 96cacf4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sdk/simple.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,12 @@ const constructFetcher = (options: FetcherOptions): FetcherFunction => {
214214
// adding apiKey to headers if it's provided
215215
const headers = options?.apiKey
216216
? {
217+
...options.headers,
217218
'X-API-KEY': options.apiKey,
218219
...params.headers,
219220
...params.requestParams?.headers,
220221
}
221-
: params.headers;
222+
: { ...options.headers, ...params.headers };
222223

223224
return options.fetcher({ ...params, headers });
224225
};

0 commit comments

Comments
 (0)