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
I was just playing with the file upload features in CI4. I have created two routes
1)$routes->get('/', 'Home::index');
where the webpage will display the form to upload a file.
2) $routes->get('/upload', 'Upload::index');
This route will actually handle the file upload mechanism. As you can see it is a GET route(which i had created by mistake).If I make the file upload request to this route then it works perfectly. Should not the framework throw an error to make a POST request to a GET route?
HTML Form
If in your routes file, you have set the $routes->setAutoRoute(false) then it's a bug. Otherwise, not - because POST request to upload/index is still reachable, even if not defined directly.
When the auto-route is turned on, all controllers and their methods are reachable. Your declaration in the routes file doesn't stop you from accessing upload/index endpoint by POST request.
I was just playing with the file upload features in CI4. I have created two routes
1)
$routes->get('/', 'Home::index');
where the webpage will display the form to upload a file.
2)
$routes->get('/upload', 'Upload::index');
This route will actually handle the file upload mechanism. As you can see it is a GET route(which i had created by mistake).If I make the file upload request to this route then it works perfectly. Should not the framework throw an error to make a POST request to a GET route?
HTML Form
Upload Controller
Context
OS: windows 10
Web server Apache/2.4.37 (Win32) OpenSSL/1.1.1a PHP/7.3.0
--
PHP version 7.3.0
The text was updated successfully, but these errors were encountered: