httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <scte...@covalent.net>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
Date Thu, 10 Jul 2003 19:56:18 GMT
on 7/8/03 0:28, stas@apache.org at stas@apache.org wrote:

> stas        2003/07/08 00:28:28
> 
> Modified:    perl-framework/Apache-Test/lib/Apache TestRequest.pm
> Log:
> Change the way the redirect_ok parameter works so that it affects only
> _that call_ to the function. Afterward it should revert to the old
> value of $RedirectOK.
> 
> Change user_agent() so that the LWP::UserAgent "requests_redirectable"
> parameter actually does something useful vis-à-vis $RedirectOK.
> 
> Submitted by:    David Wheeler <david@kineticode.com>
> Reviewed by:    stas

This patch causes the following failures, across multiple platforms:

apache/acceptpathinfo.t               36    6  16.67%  1-2 13-14 25-26
modules/alias.t                       62   20  32.26%  19-38

In analysing, I concentrated on the acceptpathinfo tests and noticed that we
are no longer following redirects, getting 301 responses where we expect
200. Backing out the patch resolves all these failures.

In the documentation, I read that the default behaviours is to follow the
redirects. In the acceptpathinfo cases, this does not seem to happen. I
tried both setting 

$Apache::TestRequest::RedirectOK = 1;

and passing a 

redirect_ok => 1

parameter to the request invocations in t/apache/acceptpathinfo.t. Neither
produces any result. Am I looking in the right place?

> Revision  Changes    Path
> 1.79      +16 -3 
> 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.78
> retrieving revision 1.79
> diff -u -r1.78 -r1.79
> --- TestRequest.pm    24 Apr 2003 05:16:57 -0000    1.78
> +++ TestRequest.pm    8 Jul 2003 07:28:27 -0000    1.79
> @@ -88,6 +88,16 @@
>          $UA = undef;
>      }
>  
> +    if (my $redir = $args->{requests_redirectable}) {
> +        if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
> +            $RedirectOK = 1;
> +        } else {
> +            $RedirectOK = 0;
> +        }
> +    } else {
> +        $RedirectOK = $redir;
> +    }
> +
>      $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
>  
>      if ($args->{keep_alive}) {
> @@ -278,9 +288,6 @@
>          }
>          push @$pass, content => $content;
>      }
> -    if (exists $keep->{redirect_ok}) {
> -        $RedirectOK = $keep->{redirect_ok};
> -    }
>      if ($keep->{cert}) {
>          set_client_cert($keep->{cert});
>      }
> @@ -291,6 +298,9 @@
>  sub UPLOAD {
>      my($url, $pass, $keep) = prepare(@_);
>  
> +    if (exists $keep->{redirect_ok}) {
> +        local $RedirectOK = $keep->{redirect_ok};
> +    }
>      if ($keep->{filename}) {
>          return upload_file($url, $keep->{filename}, $pass);
>      }
> @@ -451,6 +461,9 @@
>  
>      *$name = sub {
>          my($url, $pass, $keep) = prepare(@_);
> +        if (exists $keep->{redirect_ok}) {
> +            local $RedirectOK = $keep->{redirect_ok};
> +        }
>          return lwp_call($method, undef, $url, @$pass);
>      };
>  
> 
> 
> 
> 
> 


-- 
Covalent Technologies                             sctemme@covalent.net
Engineering group                                Voice: (415) 856 4214
303 Second Street #375 South                       Fax: (415) 856 4210
San Francisco CA 94107

   PGP Fingerprint: 7A8D B189 E871 80CB 9521  9320 C11E 7B47 964F 31D9

=======================================================
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
=======================================================


Mime
View raw message