mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Tweak some regression tests.
This commit is contained in:
parent
e1e200c005
commit
493e71a9ec
@ -124,7 +124,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type => "misc",
|
type => "misc",
|
||||||
comment => "multipart parser (boundary contains \"BoUnDaRy\")",
|
comment => "multipart parser (boundary contains \"bOuNdArY\")",
|
||||||
|
note => q(
|
||||||
|
KHTML Boundary
|
||||||
|
),
|
||||||
conf => qq(
|
conf => qq(
|
||||||
SecRuleEngine On
|
SecRuleEngine On
|
||||||
SecDebugLog $ENV{DEBUG_LOG}
|
SecDebugLog $ENV{DEBUG_LOG}
|
||||||
@ -145,19 +148,19 @@
|
|||||||
request => new HTTP::Request(
|
request => new HTTP::Request(
|
||||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||||
[
|
[
|
||||||
"Content-Type" => "multipart/form-data; boundary=------------------------------------------------BoUnDaRy",
|
"Content-Type" => "multipart/form-data; boundary=--------0xKhTmLbOuNdArY",
|
||||||
],
|
],
|
||||||
normalize_raw_request_data(
|
normalize_raw_request_data(
|
||||||
q(
|
q(
|
||||||
--------------------------------------------------BoUnDaRy
|
----------0xKhTmLbOuNdArY
|
||||||
Content-Disposition: form-data; name="a"
|
Content-Disposition: form-data; name="a"
|
||||||
|
|
||||||
1
|
1
|
||||||
--------------------------------------------------BoUnDaRy
|
----------0xKhTmLbOuNdArY
|
||||||
Content-Disposition: form-data; name="b"
|
Content-Disposition: form-data; name="b"
|
||||||
|
|
||||||
2
|
2
|
||||||
--------------------------------------------------BoUnDaRy--
|
----------0xKhTmLbOuNdArY--
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -351,6 +351,7 @@ sub do_raw_request {
|
|||||||
|
|
||||||
# Join togeather the request
|
# Join togeather the request
|
||||||
my $r = join("", @_);
|
my $r = join("", @_);
|
||||||
|
dbg($r);
|
||||||
|
|
||||||
# Write to socket
|
# Write to socket
|
||||||
print $sock "$r";
|
print $sock "$r";
|
||||||
@ -374,7 +375,11 @@ sub do_request {
|
|||||||
|
|
||||||
if (ref $r eq "HTTP::Request") {
|
if (ref $r eq "HTTP::Request") {
|
||||||
# dbg("REQUEST: ", $r);
|
# dbg("REQUEST: ", $r);
|
||||||
return $UA->request($r);
|
my $resp = $UA->request($r);
|
||||||
|
if ($opt{d}) {
|
||||||
|
dbg($resp->request()->as_string());
|
||||||
|
}
|
||||||
|
return $resp
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# dbg("REQUEST:\n", $r);
|
# dbg("REQUEST:\n", $r);
|
||||||
@ -456,7 +461,7 @@ sub dbg {
|
|||||||
my $out = join "", map {
|
my $out = join "", map {
|
||||||
(ref $_ ne "" ? Dumper($_) : $_)
|
(ref $_ ne "" ? Dumper($_) : $_)
|
||||||
} @_;
|
} @_;
|
||||||
$out =~ s/^/DBG: /m;
|
$out =~ s/^/DBG: /mg;
|
||||||
print STDOUT "$out\n";
|
print STDOUT "$out\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user