mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:20:21 +00:00
refactor: lint cleanups and helpers
This commit is contained in:
@@ -3,6 +3,8 @@ import { ProxyAgent } from "undici";
|
||||
|
||||
export function makeProxyFetch(proxyUrl: string): typeof fetch {
|
||||
const agent = new ProxyAgent(proxyUrl);
|
||||
return (input: RequestInfo | URL, init?: RequestInit) =>
|
||||
fetch(input, { ...(init ?? {}), dispatcher: agent });
|
||||
return (input: RequestInfo | URL, init?: RequestInit) => {
|
||||
const base = init ? { ...init } : {};
|
||||
return fetch(input, { ...base, dispatcher: agent });
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user