@medialane/sdk 0.124.0 → 0.125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -494,6 +494,7 @@ interface BackendProxyConfig {
494
494
  name: string;
495
495
  header: string;
496
496
  };
497
+ forwardHeaders?: readonly string[];
497
498
  }
498
499
  declare function createBackendProxyHandler(config: BackendProxyConfig): (req: Request) => Promise<Response>;
499
500
 
package/dist/index.d.ts CHANGED
@@ -494,6 +494,7 @@ interface BackendProxyConfig {
494
494
  name: string;
495
495
  header: string;
496
496
  };
497
+ forwardHeaders?: readonly string[];
497
498
  }
498
499
  declare function createBackendProxyHandler(config: BackendProxyConfig): (req: Request) => Promise<Response>;
499
500
 
package/dist/index.js CHANGED
@@ -1520,6 +1520,10 @@ function createBackendProxyHandler(config) {
1520
1520
  const value = readCookie(req, config.forwardCookie.name);
1521
1521
  if (value) headers2[config.forwardCookie.header] = value;
1522
1522
  }
1523
+ for (const name of config.forwardHeaders ?? []) {
1524
+ const value = req.headers.get(name);
1525
+ if (value) headers2[name] = value;
1526
+ }
1523
1527
  try {
1524
1528
  const upstream = await doFetch(endpoint2, {
1525
1529
  method: "POST",