diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 90a9fdc619e0..8eae06f9c9d7 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -326,17 +326,6 @@ protected function handleRequest(RouteCollectionInterface $routes = null, $cache $this->benchmark->stop('controller'); } - // Handle any redirects - if ($returned instanceof RedirectResponse) - { - if ($returnResponse) - { - return $returned; - } - - $this->callExit(EXIT_SUCCESS); - } - // If $returned is a string, then the controller output something, // probably a view, instead of echoing it directly. Send it along // so it can be used with the output. diff --git a/system/HTTP/Response.php b/system/HTTP/Response.php index 50393fc02d73..4cf7d113a1af 100644 --- a/system/HTTP/Response.php +++ b/system/HTTP/Response.php @@ -755,7 +755,7 @@ public function redirect(string $uri, string $method = 'auto', int $code = null) } $this->setStatusCode($code); - $this->sendHeaders(); + return $this; }