mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:18:28 +00:00
refactor(telegram): avoid double-wrapping proxy fetch
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { ProxyAgent, fetch as undiciFetch } from "undici";
|
||||
import { wrapFetchWithAbortSignal } from "../infra/fetch.js";
|
||||
|
||||
export function makeProxyFetch(proxyUrl: string): typeof fetch {
|
||||
const agent = new ProxyAgent(proxyUrl);
|
||||
@@ -10,5 +9,7 @@ export function makeProxyFetch(proxyUrl: string): typeof fetch {
|
||||
...(init as Record<string, unknown>),
|
||||
dispatcher: agent,
|
||||
}) as unknown as Promise<Response>) as typeof fetch;
|
||||
return wrapFetchWithAbortSignal(fetcher);
|
||||
// Return raw proxy fetch; call sites that need AbortSignal normalization
|
||||
// should opt into resolveFetch/wrapFetchWithAbortSignal once at the edge.
|
||||
return fetcher;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user