mirror of https://github.com/openclaw/openclaw.git
fix(ssrf): honor global family policy for pinned dispatcher
This commit is contained in:
parent
0e3ed28950
commit
30fd2bbe19
|
|
@ -13,7 +13,7 @@ vi.mock("undici", () => ({
|
|||
import { createPinnedDispatcher, type PinnedHostname } from "./ssrf.js";
|
||||
|
||||
describe("createPinnedDispatcher", () => {
|
||||
it("enables network family auto-selection for pinned lookups", () => {
|
||||
it("uses pinned lookup without overriding global family policy", () => {
|
||||
const lookup = vi.fn() as unknown as PinnedHostname["lookup"];
|
||||
const pinned: PinnedHostname = {
|
||||
hostname: "api.telegram.org",
|
||||
|
|
@ -27,9 +27,11 @@ describe("createPinnedDispatcher", () => {
|
|||
expect(agentCtor).toHaveBeenCalledWith({
|
||||
connect: {
|
||||
lookup,
|
||||
autoSelectFamily: true,
|
||||
autoSelectFamilyAttemptTimeout: 300,
|
||||
},
|
||||
});
|
||||
const firstCallArg = agentCtor.mock.calls[0]?.[0] as
|
||||
| { connect?: Record<string, unknown> }
|
||||
| undefined;
|
||||
expect(firstCallArg?.connect?.autoSelectFamily).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -333,8 +333,6 @@ export function createPinnedDispatcher(pinned: PinnedHostname): Dispatcher {
|
|||
return new Agent({
|
||||
connect: {
|
||||
lookup: pinned.lookup,
|
||||
autoSelectFamily: true,
|
||||
autoSelectFamilyAttemptTimeout: 300,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue