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

This commit is contained in:
Cloudyan 2026-02-04 03:09:07 +08:00 committed by GitHub
commit 39a504773c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)