diff --git a/classes/Kohana/Request.php b/classes/Kohana/Request.php index f92e5c305..e5ee71e5d 100644 --- a/classes/Kohana/Request.php +++ b/classes/Kohana/Request.php @@ -974,9 +974,10 @@ public function execute() if ( ! $this->_route instanceof Route) { - throw HTTP_Exception::factory(404, 'Unable to find a route to match the URI: :uri', array( + return HTTP_Exception::factory(404, 'Unable to find a route to match the URI: :uri', array( ':uri' => $this->_uri, - ))->request($this); + ))->request($this) + ->get_response(); } if ( ! $this->_client instanceof Request_Client) diff --git a/tests/kohana/RequestTest.php b/tests/kohana/RequestTest.php index d0b510c34..681513233 100644 --- a/tests/kohana/RequestTest.php +++ b/tests/kohana/RequestTest.php @@ -75,8 +75,6 @@ public function test_initial() /** * Tests that the allow_external flag prevents an external request. - * - * @expectedException HTTP_Exception_404 * * @return null */ @@ -89,7 +87,8 @@ public function test_disable_external_tests() ); $request = new Request('http://www.google.com/', array(), FALSE); - $request->execute(); + + $this->assertEquals(FALSE, $request->is_external()); } /**