mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Merge 2.5.9 changes into trunk.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
### Test misc actions
|
||||
|
||||
# TODO: append
|
||||
# TODO: block
|
||||
# TODO: capture
|
||||
# TODO: chain
|
||||
@@ -10,7 +9,6 @@
|
||||
# TODO: initcol
|
||||
# TODO: multiMatch
|
||||
# TODO: pause
|
||||
# TODO: prepend
|
||||
# TODO: sanitiseArg
|
||||
# TODO: sanitiseMatched
|
||||
# TODO: sanitiseRequestHeader
|
||||
|
49
apache2/t/regression/action/10-append-prepend.t
Normal file
49
apache2/t/regression/action/10-append-prepend.t
Normal file
@@ -0,0 +1,49 @@
|
||||
# TODO: Need more tests here
|
||||
|
||||
### append
|
||||
{
|
||||
type => "action",
|
||||
comment => "append content",
|
||||
conf => qq(
|
||||
SecRuleEngine On
|
||||
SecContentInjection On
|
||||
SecDebugLog "$ENV{DEBUG_LOG}"
|
||||
SecDebugLogLevel 9
|
||||
SecAction "phase:1,setvar:tx.test=test"
|
||||
SecAction "phase:2,append:'APPEND: \%{tx.test}'"
|
||||
),
|
||||
match_log => {
|
||||
debug => [ "Added content to bottom: APPEND: test", 1 ],
|
||||
},
|
||||
match_response => {
|
||||
status => qr/^200$/,
|
||||
content => qr/APPEND: test$/,
|
||||
},
|
||||
request => new HTTP::Request(
|
||||
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||
),
|
||||
},
|
||||
|
||||
### prepend
|
||||
{
|
||||
type => "action",
|
||||
comment => "prepend content",
|
||||
conf => qq(
|
||||
SecRuleEngine On
|
||||
SecContentInjection On
|
||||
SecDebugLog "$ENV{DEBUG_LOG}"
|
||||
SecDebugLogLevel 9
|
||||
SecAction "phase:1,setvar:tx.test=test"
|
||||
SecAction "phase:2,prepend:'PREPEND: \%{tx.test}'"
|
||||
),
|
||||
match_log => {
|
||||
debug => [ "Added content to top: PREPEND: test", 1 ],
|
||||
},
|
||||
match_response => {
|
||||
status => qr/^200$/,
|
||||
content => qr/^PREPEND: test/,
|
||||
},
|
||||
request => new HTTP::Request(
|
||||
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||
),
|
||||
},
|
Reference in New Issue
Block a user