We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e47248a commit de64330Copy full SHA for de64330
1 file changed
src/client.ts
@@ -181,6 +181,18 @@ export class SFCNodes {
181
this.fetch = options.fetch ?? Shims.getDefaultFetch();
182
this.#encoder = Opts.FallbackEncoder;
183
184
+ const customHeadersEnv = readEnv('SFC_NODES_CUSTOM_HEADERS');
185
+ if (customHeadersEnv) {
186
+ const parsed: Record<string, string> = {};
187
+ for (const line of customHeadersEnv.split('\n')) {
188
+ const colon = line.indexOf(':');
189
+ if (colon >= 0) {
190
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
191
+ }
192
193
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
194
195
+
196
this._options = options;
197
198
this.bearerToken = bearerToken;
0 commit comments