Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory sc8-pr-cvs1:/tmp/cvs-serv21756/t
Modified Files:
02-generic.t
Log Message:
More tests on POST followed by redirects
Index: 02-generic.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** 02-generic.t 14 Jul 2003 08:21:08 -0000 1.28
--- 02-generic.t 2 Oct 2003 08:59:33 -0000 1.29
***************
*** 6,9 ****
--- 6,10 ----
use strict;
+ use CGI;
use CGI::Cookie;
use HTTP::Response;
***************
*** 433,436 ****
--- 434,441 ----
method => 'post',
text_require => [ 'abcde' ], },
+ { url => abs_url($URL, '/redirect'),
+ method => 'post',
+ params => [ location => '/test-file2' ],
+ text_require => [ 'UUPIPEOUT' ], },
];
***************
*** 789,794 ****
$connect->send_response($response);
} elsif($path eq '/redirect') {
my $response = new HTTP::Response(RC_FOUND);
! $response->header(Location => '/test-file1');
$connect->send_response($response);
--- 794,806 ----
$connect->send_response($response);
} elsif($path eq '/redirect') {
+ my $location;
+ if($request->content) {
+ my $query = CGI->new($request->content);
+ $location = $query->param('location')
+ }
+ $location ||= '/test-file1';
+
my $response = new HTTP::Response(RC_FOUND);
! $response->header(Location => $location);
$connect->send_response($response);
|