mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:28:28 +00:00
fix: normalize abort signals for fetch
This commit is contained in:
@@ -28,3 +28,9 @@ export function wrapFetchWithAbortSignal(fetchImpl: typeof fetch): typeof fetch
|
||||
}) as typeof fetch;
|
||||
return Object.assign(wrapped, fetchImpl);
|
||||
}
|
||||
|
||||
export function resolveFetch(fetchImpl?: typeof fetch): typeof fetch | undefined {
|
||||
const resolved = fetchImpl ?? globalThis.fetch;
|
||||
if (!resolved) return undefined;
|
||||
return wrapFetchWithAbortSignal(resolved);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user