httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
Date Tue, 08 Jul 2003 07:28:28 GMT
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
  
  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);
       };
   
  
  
  

Mime
View raw message