theory 2004/10/22 15:09:54
Modified: perl-framework/Apache-Test Changes
perl-framework/Apache-Test/lib/Apache TestRequest.pm
Log:
Redirect from POST fixes (or prevention, depending on how you lok at it).
Revision Changes Path
1.184 +7 -0 httpd-test/perl-framework/Apache-Test/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- Changes 22 Oct 2004 21:08:58 -0000 1.183
+++ Changes 22 Oct 2004 22:09:54 -0000 1.184
@@ -8,6 +8,13 @@
=item 1.16-dev
+Documented that redirection does not with "POST" requests in
+Apache::TestRequest unless LWP is installed. Also modified
+the redirect_ok() method to ensure that such is the case.
+[David Wheeler]
+
+
+
=item 1.15 - October 22, 2004
add new test_config make target, equivalent to t/TEST -conf,
1.101 +7 -2
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
Index: TestRequest.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- TestRequest.pm 18 Oct 2004 22:13:35 -0000 1.100
+++ TestRequest.pm 22 Oct 2004 22:09:54 -0000 1.101
@@ -199,8 +199,9 @@
$RedirectOK = 1;
sub redirect_ok {
- my($self, $request) = @_;
- return 0 if $request->method eq 'POST';
+ my $self = shift;
+ return $self->SUPER::redirect_ok(@_) if $have_lwp;
+ return 0 if shift->method eq 'POST';
$RedirectOK;
}
@@ -761,6 +762,10 @@
my $redir = have_lwp() ? [qw(GET HEAD POST)] : 1;
Apache::TestRequest::user_agent(reset => 1,
requests_redirectable => $redir);
+
+But note that redirection will B<not> work with C<POST> unless LWP is
+installed. It's best, therefore, to check C<have_lwp> before running
+tests that rely on a redirection from C<POST>.
=head1 FUNCTIONS