Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
whoops, I wasn't handling 404s
  • Loading branch information
Stevan Little committed Dec 8, 2009
1 parent 085c51e commit e0cbe36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Plack/App/Path/Router.pm
Expand Up @@ -46,7 +46,7 @@ sub call {
return $res->finalize
}

return;
return [ 404, [ 'Content-Type' => 'text/html' ], [ 'Not Found' ] ];
}

__PACKAGE__->meta->make_immutable;
Expand Down
11 changes: 8 additions & 3 deletions t/001_basic.t
Expand Up @@ -50,17 +50,22 @@ test_psgi
{
my $req = HTTP::Request->new(GET => "http://localhost/testing");
my $res = $cb->($req);
is($res->content, 'testing', '... got the right value for index');
is($res->content, 'testing', '... got the right value for /testing');
}
{
my $req = HTTP::Request->new(GET => "http://localhost/testing/stuff");
my $res = $cb->($req);
is($res->content, 'testing, stuff', '... got the right value for index');
is($res->content, 'testing, stuff', '... got the right value for /testing/stuff');
}
{
my $req = HTTP::Request->new(GET => "http://localhost/testing/edit/things");
my $res = $cb->($req);
is($res->content, 'testing, things', '... got the right value for index');
is($res->content, 'testing, things', '... got the right value for /testing/edit/things');
}
{
my $req = HTTP::Request->new(GET => "http://localhost/foo/bar/baz");
my $res = $cb->($req);
is($res->content, 'Not Found', '... got the right value for 404');
}
};

Expand Down

0 comments on commit e0cbe36

Please sign in to comment.