Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI returns "200 OK" when PageNotFound #8011

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Oct 6, 2023

Description
Fixes #8009

Navigate to http://localhost:8080/404, you will get "200 OK" status code.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 6, 2023
@@ -979,8 +979,7 @@ protected function display404errors(PageNotFoundException $e)
// Display 404 Errors
$this->response->setStatusCode($e->getCode());

echo $this->outputBufferingEnd();
flush();
$this->outputBufferingEnd();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the code now, I don't understand why it was flushing here.
96a0d4f3#diff-d913ae68414ad947e24e588e6ee68d68194142a8aae52e61e0aab2cc7f120e0cL982
No response headers have been sent yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like @iRedds was just replacing the functionality that was already there.

@kenjis kenjis changed the title fix: CI returns 200 OK to PageNotFound fix: CI returns "200 OK" to PageNotFound Oct 6, 2023
@kenjis kenjis added the 4.4 label Oct 6, 2023
@kenjis kenjis changed the title fix: CI returns "200 OK" to PageNotFound fix: CI returns "200 OK" when PageNotFound Oct 6, 2023
@kenjis kenjis merged commit 56ed7b2 into codeigniter4:develop Oct 8, 2023
62 checks passed
@kenjis kenjis deleted the fix-200-OK-to-404 branch October 8, 2023 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: CI returns 200 OK even though the route does not exist
4 participants