mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
Adds test case for #1850
This commit is contained in:
parent
e1e8a01ed2
commit
065c2e67b6
@ -91,6 +91,7 @@ TESTS+=test/test-cases/regression/issue-1785.json
|
||||
TESTS+=test/test-cases/regression/issue-1812.json
|
||||
TESTS+=test/test-cases/regression/issue-1831.json
|
||||
TESTS+=test/test-cases/regression/issue-1844.json
|
||||
TESTS+=test/test-cases/regression/issue-1850.json
|
||||
TESTS+=test/test-cases/regression/issue-1725.json
|
||||
TESTS+=test/test-cases/regression/issue-1941.json
|
||||
TESTS+=test/test-cases/regression/variable-RESPONSE_HEADERS.json
|
||||
|
@ -123,7 +123,7 @@
|
||||
"enabled": 1,
|
||||
"version_min": 300000,
|
||||
"version_max": 0,
|
||||
"title": "actions :: trim,status:500,redirect:http://www.google.com",
|
||||
"title": "actions :: trim,status:306,redirect:http://www.google.com",
|
||||
"client": {
|
||||
"ip": "200.249.12.31",
|
||||
"port": 2313
|
||||
@ -171,12 +171,12 @@
|
||||
"audit_log": "",
|
||||
"debug_log": "\\[9\\] T \\(0\\) t:trim: \"test",
|
||||
"error_log": "",
|
||||
"http_code": 500,
|
||||
"http_code": 306,
|
||||
"redirect_url": "http://www.google.com"
|
||||
},
|
||||
"rules": [
|
||||
"SecRuleEngine On",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,status:500,redirect:'http://www.google.com'\""
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,status:306,redirect:'http://www.google.com'\""
|
||||
]
|
||||
},
|
||||
{
|
||||
|
50
test/test-cases/regression/issue-1850.json
Normal file
50
test/test-cases/regression/issue-1850.json
Normal file
@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"enabled": 1,
|
||||
"version_min": 209000,
|
||||
"version_max": -1,
|
||||
"title": "Override the default status code if not suitable to redirect action",
|
||||
"url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/1850",
|
||||
"client": {
|
||||
"ip": "200.249.12.31",
|
||||
"port": 2313
|
||||
},
|
||||
"server": {
|
||||
"ip": "200.249.12.31",
|
||||
"port": 80
|
||||
},
|
||||
"request": {
|
||||
"headers": {
|
||||
"Host": "net.tutsplus.com",
|
||||
"User-Agent": "",
|
||||
"Accept": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8",
|
||||
"Accept-Language": "en-us,en;q=0.5",
|
||||
"Accept-Encoding": "gzip,deflate",
|
||||
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
||||
"Keep-Alive": "300",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": "PHPSESSID=r2t5uvjq435r4q7ib3vtdjq120",
|
||||
"Pragma": "no-cache",
|
||||
"Cache-Control": "no-cache"
|
||||
},
|
||||
"uri": "\/test.pl?foo=£&bar=%C2%A3",
|
||||
"method": "GET",
|
||||
"http_version": 1.1,
|
||||
"body": ""
|
||||
},
|
||||
"response": {
|
||||
"headers": {
|
||||
"Content-Type": "text\/xml; charset=utf-8\n\r",
|
||||
"Content-Length": "length\n\r"
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"http_code": 302
|
||||
},
|
||||
"rules": [
|
||||
"SecRuleEngine On",
|
||||
"SecDefaultAction \"phase:1,status:404,deny\"",
|
||||
"SecRule REQUEST_URI \"@contains /\" \"id:2000001,phase:1,log,redirect:'http://1.1.1.1/failed.html',t:none,msg:\"Unauthorized administrator request'\""
|
||||
]
|
||||
}
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user