-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Routing: methods must be in uppercase since v4 ?! #3006
Comments
FastRoute handles route matching. You can go complain over on that repo. I suggest that you change your tone. It's rather abrasive. |
I suggest that you change your documentation and way of upgrading. It's really frustrating and annoying. |
btw: FastRoute did not change (v1.3.0 in both systems). It's your code (vendor/slim/slim/Slim/Routing/RouteCollector.php) which seems to be responsible for this problem. Pointing the finger is easy ... the "map" function is defined in your source. |
Hi @snoopy72 I have checked the Slim 3, 4 and FastRoute documetation about this specific parameter. v3: http://www.slimframework.com/docs/v3/objects/router.html#custom-route All pages shows that the HTTP method name must be written in UPPERCASE. Slim 3: $app->map(['GET', 'POST'], '/books', function ($request, $response, $args) {
// ...
}); Slim 4: $app->map(['GET', 'POST'], '/books', function ($request, $response, $args) {
// ...
}); Fastroute: $r->addRoute(['GET', 'POST'], '/test', 'handler');
Just because this "rule" applies to your company or solution does not mean that this rule applies equally to everyone else out there, and certainly not to libraries or frameworks.
I think lowercase for the HTTP methods was never so documented and officially supported. |
slim v3: working without problems:
slim v4: error
Solution: "simply" change all methods to uppercase
WHY ?!
that is an array of strings and it does not mapper, if strings are case-sensivtive for this part.
we have thousands of routes (and no, there is no way to bundle them, it's just a big and complex app) and we use UPPERCASE only for const and defined values ... not for string arrays.
2nd reason, why we are not quiclly able to change all to UPPERCASE: some automatic procedures, which are documenting our sources, have to be changed and that would brings lot more work for us. we changes the map function in the slim sources to accept lower strings and there seems not be any problems. so, why has this be changed ?
pls change that back to enable us, using slim in future.
The text was updated successfully, but these errors were encountered: