Skip to content

Commit b8789ab

Browse files
asterite3Felipe Zimmerle
authored andcommitted
add a test for negated implicit @rx operator
1 parent 039bd2c commit b8789ab

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

test/test-cases/regression/operator-rx.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,48 @@
4242
"SecRuleEngine On",
4343
"SecRule ARGS \"@rx (value1)\" \"id:1,phase:2,pass,t:trim\""
4444
]
45+
},
46+
{
47+
"enabled":1,
48+
"version_min":300000,
49+
"title":"Testing Operator :: @rx in implicit form with negation ('!')",
50+
"client":{
51+
"ip":"200.249.12.31",
52+
"port":123
53+
},
54+
"server":{
55+
"ip":"200.249.12.31",
56+
"port":80
57+
},
58+
"request":{
59+
"headers":{
60+
"Host":"localhost",
61+
"User-Agent":"curl/7.38.0",
62+
"Accept":"*/*",
63+
"Content-Length": "27",
64+
"Content-Type": "application/x-www-form-urlencoded"
65+
},
66+
"uri":"/",
67+
"method":"HEAD",
68+
"body": [ ]
69+
},
70+
"response":{
71+
"headers":{
72+
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
73+
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
74+
"Content-Type":"text/html"
75+
},
76+
"body":[
77+
"no need."
78+
]
79+
},
80+
"expected":{
81+
"debug_log":"Executing operator \"Rx\" with param \"\\^0\\$\"",
82+
"error_log":"Matched \"Operator `Rx' with parameter `\\^0\\$'"
83+
},
84+
"rules":[
85+
"SecRuleEngine On",
86+
"SecRule REQUEST_HEADERS:Content-Length \"!^0$\" \"id:1,phase:2,pass,t:trim\""
87+
]
4588
}
4689
]

0 commit comments

Comments
 (0)