mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
fix: format gateway canvas auth tests (openclaw#14661) thanks @sumleo
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user