Skip to content

Commit db6d5f5

Browse files
committed
add ipv6 unit test
1 parent 7276e4f commit db6d5f5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

t/ipdb.t

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ http {
5959
return 200 $ipdb_country_name;
6060
}
6161
62+
location /ipv6/country/ {
63+
return 200 null$ipdb_country_name;
64+
}
65+
6266
location /region/ {
6367
return 200 $ipdb_region_name;
6468
}
@@ -76,7 +80,7 @@ http {
7680
7781
EOF
7882

79-
$t->try_run('no ipdb')->plan(7);
83+
$t->try_run('no ipdb')->plan(8);
8084

8185
###############################################################################
8286
like(http(<<EOF), qr/testipdb/, 'ipdb test');
@@ -94,6 +98,14 @@ X-Forwarded-For: 36.102.4.81,192.168.0.1
9498
EOF
9599

96100

101+
like(http(<<EOF), qr/null$/, 'ipdb country');
102+
GET /ipv6/country/ HTTP/1.0
103+
Host: localhost
104+
X-Forwarded-For: a80::7cfc:c767:aded:c04e
105+
106+
EOF
107+
108+
97109
like(http(<<EOF), qr/局域网/, 'ipdb country proxy');
98110
GET /country/ HTTP/1.0
99111
Host: localhost

0 commit comments

Comments
 (0)