fix(telegram): move network fallback to resolver-scoped dispatchers (#40740)

Merged via squash.

Prepared head SHA: a4456d48b4
Co-authored-by: sircrumpet <4436535+sircrumpet@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
Eugene
2026-03-10 15:58:51 +10:00
committed by GitHub
parent d1a59557b5
commit 45b74fb56c
23 changed files with 1641 additions and 390 deletions

View File

@@ -29,7 +29,7 @@ vi.mock("undici", () => ({
setGlobalDispatcher: mocks.setGlobalDispatcher,
}));
import { makeProxyFetch } from "./proxy.js";
import { getProxyUrlFromFetch, makeProxyFetch } from "./proxy.js";
describe("makeProxyFetch", () => {
it("uses undici fetch with ProxyAgent dispatcher", async () => {
@@ -46,4 +46,11 @@ describe("makeProxyFetch", () => {
);
expect(mocks.setGlobalDispatcher).not.toHaveBeenCalled();
});
it("attaches proxy metadata for resolver transport handling", () => {
const proxyUrl = "http://proxy.test:8080";
const proxyFetch = makeProxyFetch(proxyUrl);
expect(getProxyUrlFromFetch(proxyFetch)).toBe(proxyUrl);
});
});