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 c7c3f2f commit 6573f02Copy full SHA for 6573f02
1 file changed
src/client.ts
@@ -208,6 +208,18 @@ export class Arcade {
208
this.fetch = options.fetch ?? Shims.getDefaultFetch();
209
this.#encoder = Opts.FallbackEncoder;
210
211
+ const customHeadersEnv = readEnv('ARCADE_CUSTOM_HEADERS');
212
+ if (customHeadersEnv) {
213
+ const parsed: Record<string, string> = {};
214
+ for (const line of customHeadersEnv.split('\n')) {
215
+ const colon = line.indexOf(':');
216
+ if (colon >= 0) {
217
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
218
+ }
219
220
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
221
222
+
223
this._options = options;
224
this.idempotencyHeader = 'Idempotency-Key';
225
0 commit comments