httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Zentner <...@2bz.de>
Subject Fix: Apache::TestRequest::redirect_ok
Date Mon, 18 Oct 2004 13:57:54 GMT

Hi,

on a older server, with perl 5.6.1 call 
Apache::TestRequest::redirect_ok and return 0 for POST requests, even 
if I overwrite this behavior with

Apache::TestRequest::user_agent( reset      => 1,
                                  cookie_jar => $cookie_jar,
                                  requests_redirectable => [ qw/GET POST 
HEAD/ ],
                                   );

this patch fix that by removing
   return 0 if $request->method eq 'POST';

also the parameters for redirect_ok differ from older LWP to the newer.

Older ones use ( $self, $request ) newer use ( $self, $request, 
$response);

This routine forward the redirect_ok call to the underlying 
class(LWP::UserAgent, but maybe not always) if possible else, fallback 
to RedirectOK.

--- a/Apache-Test-1.14/lib/Apache/TestRequest.pm        Thu Sep 30 
05:32:13 2004
+++ b/Apache-Test-1.14/lib/Apache/TestRequest.pm        Mon Oct 18 
15:35:52 2004
@@ -199,8 +199,11 @@
  $RedirectOK = 1;

  sub redirect_ok {
-    my($self, $request) = @_;
-    return 0 if $request->method eq 'POST';
+#    my($self, $request) = @_;
+    if ( $have_lwp ) {
+        my $s = $_[0]->can('SUPER::redirect_ok');
+        goto $s if $s;
+    }
      $RedirectOK;
  }

Have a nice day.

--
Boris


Mime
View raw message