Skip to content

Commit bb229c9

Browse files
feat(root): use additonal headers on constants fetch
- Added code in `fetchConstants()` to check if `getAdditionalHeadersCb` is set - When available, retrieves additional headers using the callback with appropriate parameters - Applies any returned headers to the request before execution TICKET: WP-000000
1 parent d5a4e64 commit bb229c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/sdk-api/src/bitgoAPI.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ export class BitGoAPI implements BitGoBase {
553553
if (this._customProxyAgent) {
554554
resultPromise.agent(this._customProxyAgent);
555555
}
556+
if (this.getAdditionalHeadersCb) {
557+
const additionalHeaders = this.getAdditionalHeadersCb('get', this.url('/client/constants'));
558+
for (const { key, value } of additionalHeaders) {
559+
resultPromise.set(key, value);
560+
}
561+
}
556562
const result = await resultPromise;
557563
BitGoAPI._constants[env] = result.body.constants;
558564

0 commit comments

Comments
 (0)