Explorar o código

fix: provider headers from config not applied to fetch requests (#11788)

Cloudyan hai 7 meses
pai
achega
39a504773c
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      packages/opencode/src/provider/provider.ts

+ 6 - 0
packages/opencode/src/provider/provider.ts

@@ -1001,6 +1001,12 @@ export namespace Provider {
         const fetchFn = customFetch ?? fetch
         const opts = init ?? {}
 
+        // Merge configured headers into request headers
+        opts.headers = {
+          ...(typeof opts.headers === 'object' ? opts.headers : {}),
+          ...options["headers"],
+        }
+
         if (options["timeout"] !== undefined && options["timeout"] !== null) {
           const signals: AbortSignal[] = []
           if (opts.signal) signals.push(opts.signal)