mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:34:34 +00:00
fix(browser): unify SSRF guard path for navigation
This commit is contained in:
@@ -182,4 +182,24 @@ describe("browser config", () => {
|
||||
});
|
||||
expect(resolved.extraArgs).toEqual([]);
|
||||
});
|
||||
|
||||
it("resolves browser SSRF policy when configured", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
ssrfPolicy: {
|
||||
allowPrivateNetwork: true,
|
||||
allowedHostnames: [" localhost ", ""],
|
||||
hostnameAllowlist: [" *.trusted.example ", " "],
|
||||
},
|
||||
});
|
||||
expect(resolved.ssrfPolicy).toEqual({
|
||||
allowPrivateNetwork: true,
|
||||
allowedHostnames: ["localhost"],
|
||||
hostnameAllowlist: ["*.trusted.example"],
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps browser SSRF policy undefined when not configured", () => {
|
||||
const resolved = resolveBrowserConfig({});
|
||||
expect(resolved.ssrfPolicy).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user