From 4585216ae6f5a05741b4fa25b84eb4a5fdc7cf76 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 4 Sep 2018 22:02:56 -0300 Subject: [PATCH] Adds more tests to REQUEST_BASENAME Meant to test #1795 --- .../regression/variable-REQUEST_BASENAME.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/test-cases/regression/variable-REQUEST_BASENAME.json b/test/test-cases/regression/variable-REQUEST_BASENAME.json index 27cbbb64..6a8014c0 100644 --- a/test/test-cases/regression/variable-REQUEST_BASENAME.json +++ b/test/test-cases/regression/variable-REQUEST_BASENAME.json @@ -39,5 +39,46 @@ "SecRuleEngine On", "SecRule REQUEST_BASENAME \"@contains test \" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_BASENAME", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.11", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"27", + "Content-Type":"application/x-www-form-urlencoded" + }, + "uri":"/my_app.asp?apath=/my/cool/path.com", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Target value: \"my_app.asp\" \\(Variable: REQUEST_BASENAME\\)" + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_BASENAME \"@contains test \" \"id:1,phase:3,pass,t:trim\"" + ] } ]