You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2005/05/13 07:10:28 UTC

svn commit: r169940 - in /httpd/apreq/trunk/glue/perl/t: apreq/cookie.t response/TestApReq/cookie.pm

Author: joes
Date: Thu May 12 22:10:27 2005
New Revision: 169940

URL: http://svn.apache.org/viewcvs?rev=169940&view=rev
Log:
Apache2::Cookie->new munges domain/path arguments.
No clue why this happens, but here's a test that
tickles the bug.

Modified:
    httpd/apreq/trunk/glue/perl/t/apreq/cookie.t
    httpd/apreq/trunk/glue/perl/t/response/TestApReq/cookie.pm

Modified: httpd/apreq/trunk/glue/perl/t/apreq/cookie.t
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/t/apreq/cookie.t?rev=169940&r1=169939&r2=169940&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/t/apreq/cookie.t (original)
+++ httpd/apreq/trunk/glue/perl/t/apreq/cookie.t Thu May 12 22:10:27 2005
@@ -6,7 +6,7 @@
 use Apache::TestUtil;
 use Apache::TestRequest qw(GET_BODY GET_HEAD);
 
-plan tests => 7, have_lwp;#under_construction; # have_lwp
+plan tests => 8, have_lwp;
 
 require HTTP::Cookies;
 
@@ -16,6 +16,16 @@
     my $test  = 'new';
     my $value = 'bar';
     ok t_cmp(GET_BODY("$location?test=new"),
+             $value,
+             $test);
+}
+{
+    # XXX why does this test fail?
+    my $test  = 'bake';
+    my $value = 'foo=bar; path=/quux; domain=example.com';
+    my ($header) = (GET_HEAD("$location?test=bake") 
+                   =~ /^#Set-Cookie:\s+(.+)/m) ;
+    ok t_cmp($header, 
              $value,
              $test);
 }

Modified: httpd/apreq/trunk/glue/perl/t/response/TestApReq/cookie.pm
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/t/response/TestApReq/cookie.pm?rev=169940&r1=169939&r2=169940&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/t/response/TestApReq/cookie.pm (original)
+++ httpd/apreq/trunk/glue/perl/t/response/TestApReq/cookie.pm Thu May 12 22:10:27 2005
@@ -33,7 +33,10 @@
         @expires = ("expires", $req->APR::Request::args('expires'))
             if $req->APR::Request::args('expires');
         my $cookie = Apache2::Cookie->new($r, name => "foo",
-                                             value => "bar", @expires);
+                                             value => "bar",
+                                            domain => "example.com",
+                                              path => "/quux",
+                                          @expires);
         if ($test eq "bake") {
             $cookie->bake($req);
         }