Skip to content

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

Merged
kenjis merged 2 commits into
codeigniter4:developfrom
kenjis:fix-200-OK-to-404
Oct 8, 2023
Merged

kenjis merged 2 commits into
codeigniter4:developfrom
kenjis:fix-200-OK-to-404

Conversation

@kenjis

@kenjis kenjis commented Oct 6, 2023

Copy link
Copy Markdown
Member

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
Comment thread system/CodeIgniter.php

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

Copy link
Copy Markdown
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
Copy Markdown
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 force-pushed the fix-200-OK-to-404 branch from 320f408 to 33708a8 Compare October 6, 2023 03:42
@kenjis
kenjis merged commit 56ed7b2 into codeigniter4:develop Oct 8, 2023
@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

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