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 fe45683 commit c8a3244Copy full SHA for c8a3244
1 file changed
src/client.ts
@@ -549,6 +549,18 @@ export class Lithic {
549
this.fetch = options.fetch ?? Shims.getDefaultFetch();
550
this.#encoder = Opts.FallbackEncoder;
551
552
+ const customHeadersEnv = readEnv('LITHIC_CUSTOM_HEADERS');
553
+ if (customHeadersEnv) {
554
+ const parsed: Record<string, string> = {};
555
+ for (const line of customHeadersEnv.split('\n')) {
556
+ const colon = line.indexOf(':');
557
+ if (colon >= 0) {
558
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
559
+ }
560
561
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
562
563
+
564
this._options = options;
565
566
this.apiKey = apiKey;
0 commit comments