You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--- a/app/Config/Routes.php+++ b/app/Config/Routes.php@@ -19,7 +19,7 @@ $routes->set404Override();
// where controller filters or CSRF protection are bypassed.
// If you don't want to define all routes, please use the Auto Routing (Improved).
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
-// $routes->setAutoRoute(false);+$routes->setAutoRoute(true);
/*
* --------------------------------------------------------------------
Example of filter behavior for 404 https://forum.codeigniter.com/showthread.php?tid=86691
When a response is created via an exception, no filters are applied. It is ok. But it is not suitable for changing behavior for the API
PHP Version
8.1
CodeIgniter4 Version
4.3.1 and develop ea1b628
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
n/a
What happened?
When enabling Auto Routing (Legacy), if we navigate to the URI that does not exist,
global filters are executed.
Steps to Reproduce
Navigate to
http://localhost:8080/xxx
.The stack trace:
Expected Output
No filter is executed.
Anything else?
But if we navigate to
http://localhost:8080/404
, no filter is executed.Because
404
is invalid as a classname, and throw an exception here:CodeIgniter4/system/Router/AutoRouter.php
Lines 98 to 100 in ea1b628
The text was updated successfully, but these errors were encountered: