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 3e8db1a commit 0578f47Copy full SHA for 0578f47
1 file changed
src/client.ts
@@ -258,6 +258,18 @@ export class Hypeman {
258
this.fetch = options.fetch ?? Shims.getDefaultFetch();
259
this.#encoder = Opts.FallbackEncoder;
260
261
+ const customHeadersEnv = readEnv('HYPEMAN_CUSTOM_HEADERS');
262
+ if (customHeadersEnv) {
263
+ const parsed: Record<string, string> = {};
264
+ for (const line of customHeadersEnv.split('\n')) {
265
+ const colon = line.indexOf(':');
266
+ if (colon >= 0) {
267
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
268
+ }
269
270
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
271
272
+
273
this._options = options;
274
275
this.apiKey = apiKey;
0 commit comments