->req->path has no leading /, which bites me so many times... v0.05
Hu Hailin [Mon, 7 Aug 2006 16:17:50 +0000 (16:17 +0000)]
lib/Catalyst/Plugin/Session/State/Cookie.pm
t/basic.t

index a87ccc8..9cd6a46 100644 (file)
@@ -49,7 +49,7 @@ sub cookie_is_rejecting {
     my ( $c, $cookie ) = @_;
     
     if ( $cookie->{path} ) {
-        return 1 if index $c->request->path, $cookie->{path};
+        return 1 if index '/'.$c->request->path, $cookie->{path};
     }
     
     return 0;
index 843ff26..ec5e4c7 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -78,7 +78,7 @@ $req->clear;
 can_ok( $m, "cookie_is_rejecting" );
 
 %req_cookies = ( path => '/foo' );
-$req->set_always( path => '/' );
+$req->set_always( path => '' );
 ok( $cxt->cookie_is_rejecting(\%req_cookies), "cookie is rejecting" );
-$req->set_always( path => '/foo/bar' );
+$req->set_always( path => 'foo/bar' );
 ok( !$cxt->cookie_is_rejecting(\%req_cookies), "cookie is not rejecting" );