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 c217b4e commit 8c3a517Copy full SHA for 8c3a517
1 file changed
src/client.ts
@@ -203,6 +203,18 @@ export class ScanDocuments {
203
this.fetch = options.fetch ?? Shims.getDefaultFetch();
204
this.#encoder = Opts.FallbackEncoder;
205
206
+ const customHeadersEnv = readEnv('SCAN_DOCUMENTS_CUSTOM_HEADERS');
207
+ if (customHeadersEnv) {
208
+ const parsed: Record<string, string> = {};
209
+ for (const line of customHeadersEnv.split('\n')) {
210
+ const colon = line.indexOf(':');
211
+ if (colon >= 0) {
212
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
213
+ }
214
215
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
216
217
+
218
this._options = options;
219
220
this.apiKey = apiKey;
0 commit comments