Skip to content

Commit 56ed7b2

Browse files
authored
Merge pull request #8011 from kenjis/fix-200-OK-to-404
fix: CI returns "200 OK" when PageNotFound
2 parents 83b64b4 + 33708a8 commit 56ed7b2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,8 +979,7 @@ protected function display404errors(PageNotFoundException $e)
979979
// Display 404 Errors
980980
$this->response->setStatusCode($e->getCode());
981981

982-
echo $this->outputBufferingEnd();
983-
flush();
982+
$this->outputBufferingEnd();
984983

985984
// Throws new PageNotFoundException and remove exception message on production.
986985
throw PageNotFoundException::forPageNotFound(

user_guide_src/source/changelogs/v4.4.2.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Deprecations
3232
Bugs Fixed
3333
**********
3434

35+
- **CodeIgniter:** Fixed a bug that returned "200 OK" response status code when
36+
Page Not Found.
37+
3538
See the repo's
3639
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
3740
for a complete list of bugs fixed.

0 commit comments

Comments
 (0)