Skip to content

Commit b3fbcf7

Browse files
authored
Improve test
1 parent 00e4bd5 commit b3fbcf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/modsecurity-limits.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ http {
4141
server_name localhost;
4242
4343
modsecurity on;
44-
limit_req zone=limitzone burst=2 nodelay;
44+
limit_req zone=limitzone burst=1 nodelay;
4545
4646
location /limit {
4747
modsecurity_rules '
4848
SecRuleEngine On
49-
SecRule REQUEST_URI "@rx .*" "id:1001,phase:1,log,deny,status:403,msg:\'Request reached ModSecurity\'"
49+
SecRule REQUEST_URI "@rx .*" "id:1001,phase:1,log,deny,status:555,msg:\'Request reached ModSecurity\'"
5050
';
5151
}
5252
}
@@ -66,7 +66,7 @@ my $res2 = http_get($uri);
6666
my $res3 = http_get($uri);
6767
my $res4 = http_get($uri);
6868

69-
like($res1, qr/^HTTP.*403/, 'limitreq scoring 1 (Blocked by ModSecurity)');
70-
like($res2, qr/^HTTP.*403/, 'limitreq scoring 2 (Blocked by ModSecurity)');
69+
like($res1, qr/^HTTP.*555/, 'limitreq scoring 1 (Blocked by ModSecurity)');
70+
like($res2, qr/^HTTP.*555/, 'limitreq scoring 2 (Blocked by ModSecurity)');
7171
like($res3, qr/^HTTP.*429/, 'limitreq scoring 3 (limited by nginx)');
7272
like($res4, qr/^HTTP.*429/, 'limitreq scoring 4 (limited by nginx)');

0 commit comments

Comments
 (0)