fix: format gateway canvas auth tests (openclaw#14661) thanks @sumleo

This commit is contained in:
Peter Steinberger
2026-02-13 16:59:33 +01:00
parent 3dd6d075fd
commit 9e4e1aca4a
2 changed files with 11 additions and 4 deletions

View File

@@ -1,6 +1,10 @@
import os from "node:os";
import { afterEach, describe, expect, it, vi } from "vitest";
import { isPrivateOrLoopbackAddress, pickPrimaryLanIPv4, resolveGatewayListenHosts } from "./net.js";
import {
isPrivateOrLoopbackAddress,
pickPrimaryLanIPv4,
resolveGatewayListenHosts,
} from "./net.js";
describe("resolveGatewayListenHosts", () => {
it("returns the input host when not loopback", async () => {

View File

@@ -215,9 +215,12 @@ describe("gateway canvas host auth", () => {
connId: "c-cgnat",
clientIp: cgnatIp,
});
const cgnatAllowed = await fetch(`http://127.0.0.1:${listener.port}${CANVAS_HOST_PATH}/`, {
headers: { "x-forwarded-for": cgnatIp },
});
const cgnatAllowed = await fetch(
`http://127.0.0.1:${listener.port}${CANVAS_HOST_PATH}/`,
{
headers: { "x-forwarded-for": cgnatIp },
},
);
expect(cgnatAllowed.status).toBe(200);
await new Promise<void>((resolve, reject) => {