mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 10:42:43 +00:00
refactor(security): unify local-host and tailnet CIDR checks
This commit is contained in:
@@ -104,4 +104,14 @@ describe("fetchBrowserJson loopback auth", () => {
|
||||
const headers = new Headers(init?.headers);
|
||||
expect(headers.get("authorization")).toBe("Bearer loopback-token");
|
||||
});
|
||||
|
||||
it("injects auth for IPv4-mapped IPv6 loopback URLs", async () => {
|
||||
const fetchMock = stubJsonFetchOk();
|
||||
|
||||
await fetchBrowserJson<{ ok: boolean }>("http://[::ffff:127.0.0.1]:18888/");
|
||||
|
||||
const init = fetchMock.mock.calls[0]?.[1];
|
||||
const headers = new Headers(init?.headers);
|
||||
expect(headers.get("authorization")).toBe("Bearer loopback-token");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user