Tweak some regression tests.

This commit is contained in:
brectanus 2008-06-05 16:44:18 +00:00
parent e1e200c005
commit 493e71a9ec
2 changed files with 15 additions and 7 deletions

View File

@ -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--
), ),
), ),
), ),

View File

@ -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";
} }