Apache2-POST200
view release on metacpan or search on metacpan
t/001mp-handler.t view on Meta::CPAN
ok t_cmp $resp->content_type, 'text/slain', n 'response content-type';
t_debug "GET $loc;nocheck";
$resp=GET $loc.';nocheck';
ok t_cmp $resp->code, 200, n 'POST200IpCheck Off: code 200';
ok t_cmp $resp->content, 'POST:', n 'POST200IpCheck Off: content';
t_client_log_error_is_expected;
t_debug "GET $loc;check";
$resp=GET $loc.';check';
ok t_cmp $resp->code, 404, n 'POST200IpCheck On: code 404';
t_client_log_error_is_expected;
t_debug "GET $loc;default";
$resp=GET $loc.';default';
ok t_cmp $resp->code, 404, n 'POST200IpCheck default: code 404';
t_debug "POST $loc";
$resp=POST $loc;
ok t_cmp $resp->code, 302, n 'POST => 302';
ok t_cmp $resp->header('Location'), qr#^(?!\Q$loc\E)#, n 'Location ne '.$loc;
ok t_cmp $resp->header('Location'), qr!\Q$hostport\E/mp/method\?-redirect-[A-Za-z0-9@=-]{32}$!, n 'Location';
ok t_cmp $dbh->selectall_arrayref
('SELECT data FROM p200 WHERE session=?', {},
substr( $resp->header('Location'), -32 ).':00000004')->[0]->[0],
'POST:', n 'POST result in DB';
( run in 2.287 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )