fix 404 route issue.

This commit is contained in:
Taylor Otwell 2012-02-03 09:37:22 -06:00
parent 97fb28bd00
commit d681f49920
1 changed files with 8 additions and 5 deletions

View File

@ -161,15 +161,18 @@
Request::$route = Routing\Router::route(Request::method(), URI::current()); Request::$route = Routing\Router::route(Request::method(), URI::current());
if ( ! is_null(Request::$route)) if (is_null(Request::$route))
{
$response = Request::$route->call();
}
else
{ {
Request::$route = new Routing\Route('GET /404', array(function()
{
return Response::error('404');
}));
$response = Response::error('404'); $response = Response::error('404');
} }
$response = Request::$route->call();
/** /**
* Close the session and write the active payload to persistent * Close the session and write the active payload to persistent
* storage. The session cookie will also be written and if the * storage. The session cookie will also be written and if the