Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Feb 7, 2025
1 parent b44d686 commit bfccf96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/sources/Hono.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ wrap(fetch, "fetch", function mock(original) {
{
source: "geoip",
description: "geo restrictions",
ips: ["1.3.2.0/24", "fe80::1234:5678:abcd:ef12/64"],
ips: ["1.3.2.0/24", "e98c:a7ba:2329:8c69::/64"],
},
],
blockedUserAgents: "hacker|attacker",
Expand Down Expand Up @@ -358,13 +358,13 @@ t.test("ip and bot blocking works (real socket)", opts, async (t) => {
const response2 = await fetch.fetch({
url: new URL("http://127.0.0.1:8766/"),
headers: {
"X-Forwarded-For": "fe80::1234:5678:abcd:ef12", // Blocked IP
"X-Forwarded-For": "e98c:a7ba:2329:8c69:a13a:8aff:a932:13f2", // Blocked IP
},
});
t.equal(response2.statusCode, 403);
t.equal(
response2.body,
"Your IP address is blocked due to geo restrictions. (Your IP: fe80::1234:5678:abcd:ef12)"
"Your IP address is blocked due to geo restrictions. (Your IP: e98c:a7ba:2329:8c69:a13a:8aff:a932:13f2)"
);

// Test allowed IP
Expand Down

0 comments on commit bfccf96

Please sign in to comment.