Skip to content

Commit

Permalink
Merge pull request #8011 from kenjis/fix-200-OK-to-404
Browse files Browse the repository at this point in the history
fix: CI returns "200 OK" when PageNotFound
  • Loading branch information
kenjis authored Oct 8, 2023
2 parents 83b64b4 + 33708a8 commit 56ed7b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,7 @@ protected function display404errors(PageNotFoundException $e)
// Display 404 Errors
$this->response->setStatusCode($e->getCode());

echo $this->outputBufferingEnd();
flush();
$this->outputBufferingEnd();

// Throws new PageNotFoundException and remove exception message on production.
throw PageNotFoundException::forPageNotFound(
Expand Down
3 changes: 3 additions & 0 deletions user_guide_src/source/changelogs/v4.4.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Deprecations
Bugs Fixed
**********

- **CodeIgniter:** Fixed a bug that returned "200 OK" response status code when
Page Not Found.

See the repo's
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
for a complete list of bugs fixed.

0 comments on commit 56ed7b2

Please sign in to comment.