httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Fix: Apache::TestRequest::redirect_ok
Date Mon, 18 Oct 2004 23:12:23 GMT
Boris Zentner wrote:
> 
> 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.

If I'm not mistaken David was the last who was working on this code. 
David, could you please comment on this code, commit if it's good, etc.?

Boris, aren't you dropping the case where !$have_lwp?

> --- 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


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message