fix(telegram): allow trusted explicit proxy media fetches

This commit is contained in:
Vincent Koc
2026-04-02 23:35:44 +09:00
parent 7fea8250fb
commit 4251ad6638
3 changed files with 10 additions and 1 deletions

View File

@@ -206,11 +206,13 @@ function resolveTelegramDispatcherPolicy(params: {
? {
mode: "explicit-proxy",
proxyUrl: explicitProxyUrl,
allowPrivateProxy: true,
proxyTls: { ...connect },
}
: {
mode: "explicit-proxy",
proxyUrl: explicitProxyUrl,
allowPrivateProxy: true,
},
mode: "explicit-proxy",
};

View File

@@ -112,7 +112,13 @@ async function assertExplicitProxyAllowed(
}
await resolvePinnedHostnameWithPolicy(parsedProxyUrl.hostname, {
lookupFn,
policy,
policy:
dispatcherPolicy.allowPrivateProxy === true
? {
...policy,
allowPrivateNetwork: true,
}
: policy,
});
}

View File

@@ -286,6 +286,7 @@ export type PinnedDispatcherPolicy =
| {
mode: "explicit-proxy";
proxyUrl: string;
allowPrivateProxy?: boolean;
proxyTls?: Record<string, unknown>;
pinnedHostname?: PinnedHostnameOverride;
};