Skip to content

Commit fecc429

Browse files
author
Felipe Zimmerle
committed
Adds more tests to REQUEST_BASENAME
Meant to test #1795
1 parent 7390487 commit fecc429

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tests/regression/target/00-targets.t

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,29 @@
475475
"arg1=val1&arg2=val2",
476476
),
477477
},
478-
479-
478+
{
479+
type => "target",
480+
comment => "REQUEST_BASENAME (get)",
481+
conf => qq(
482+
SecRuleEngine On
483+
SecRequestBodyAccess On
484+
SecResponseBodyAccess On
485+
SecResponseBodyMimeType null
486+
SecDebugLog $ENV{DEBUG_LOG}
487+
SecDebugLogLevel 9
488+
SecRule REQUEST_BASENAME "index.html" "phase:2,log,pass,id:500189"
489+
),
490+
match_log => {
491+
error => [ qr/Pattern match "index.html" at REQUEST_BASENAME.*/s, 1 ],
492+
debug => [ qr/Pattern match "index.html" at REQUEST_BASENAME.*/s, 1 ],
493+
},
494+
match_response => {
495+
status => qr/^200$/,
496+
},
497+
request => new HTTP::Request(
498+
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/index.html?apath=/my/cool/path.com",
499+
),
500+
},
480501

481502
# AUTH_TYPE
482503
#{

0 commit comments

Comments
 (0)