mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 19:47:28 +00:00
test(gateway): cover trusted proxy trimming
This commit is contained in:
@@ -122,6 +122,11 @@ describe("isTrustedProxyAddress", () => {
|
||||
it("ignores surrounding whitespace in CIDR entries", () => {
|
||||
expect(isTrustedProxyAddress("10.42.0.59", [" 10.42.0.0/24 "])).toBe(true);
|
||||
});
|
||||
|
||||
it("ignores blank trusted proxy entries", () => {
|
||||
expect(isTrustedProxyAddress("10.0.0.5", [" ", "\t"])).toBe(false);
|
||||
expect(isTrustedProxyAddress("10.0.0.5", [" ", "10.0.0.5", ""])).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user