Skip to content

Commit 4803e98

Browse files
committed
fix(plugin-sdk): keep fetch runtime imports lightweight
1 parent a9d8606 commit 4803e98

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/plugin-sdk/fetch-runtime.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Public fetch/proxy helpers for plugins that need wrapped fetch behavior.
22

3+
import type { GuardedFetchOptions } from "../infra/net/fetch-guard.js";
4+
35
export { resolveFetch, wrapFetchWithAbortSignal } from "../infra/fetch.js";
46
export {
57
createHttp1EnvHttpProxyAgent,
68
createHttp1ProxyAgent,
79
} from "../infra/net/undici-runtime.js";
8-
export { withTrustedEnvProxyGuardedFetchMode } from "../infra/net/fetch-guard.ts";
910
export {
1011
addActiveManagedProxyTlsOptions,
1112
resolveActiveManagedProxyTlsOptions,
@@ -24,3 +25,14 @@ export {
2425
export { getProxyUrlFromFetch, makeProxyFetch } from "../infra/net/proxy-fetch.js";
2526
export { createPinnedLookup } from "../infra/net/ssrf.js";
2627
export type { PinnedDispatcherPolicy } from "../infra/net/ssrf.js";
28+
29+
type GuardedFetchPresetOptions = Omit<
30+
GuardedFetchOptions,
31+
"mode" | "proxy" | "dangerouslyAllowEnvProxyWithoutPinnedDns"
32+
>;
33+
34+
export function withTrustedEnvProxyGuardedFetchMode(
35+
params: GuardedFetchPresetOptions,
36+
): GuardedFetchOptions {
37+
return { ...params, mode: "trusted_env_proxy" };
38+
}

0 commit comments

Comments
 (0)