We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f17ba61 commit f13bb8bCopy full SHA for f13bb8b
1 file changed
src/client.ts
@@ -192,6 +192,18 @@ export class Grid {
192
this.fetch = options.fetch ?? Shims.getDefaultFetch();
193
this.#encoder = Opts.FallbackEncoder;
194
195
+ const customHeadersEnv = readEnv('GRID_CUSTOM_HEADERS');
196
+ if (customHeadersEnv) {
197
+ const parsed: Record<string, string> = {};
198
+ for (const line of customHeadersEnv.split('\n')) {
199
+ const colon = line.indexOf(':');
200
+ if (colon >= 0) {
201
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
202
+ }
203
204
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
205
206
+
207
this._options = options;
208
209
this.apiKey = apiKey;
0 commit comments