-
Notifications
You must be signed in to change notification settings - Fork 398
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
One url make 2 action call #220
Comments
By default, route variables (aka your |
@NoNameProvided this still seems like a bug though. It shouldn't be possible for controller methods to fall through like middleware. Once a controller method has handled the request that should be the end of it. |
Yeah, it's not mentioned in the docs and this is what makes it seems like a bug the most, also that you can only return response from the first route which was hit. PR-s are welcomed for this as for any other issue, but first lets ask @pleerock if it was intentional or not? |
I'm running into this issue as well. I have an action which listens on |
Scratch this...it works, but after further consideration, I don't think that falling through should really be the default (after all, in Express routes, you have to explicitly fall through by accepting a |
Actually I don’t think anyone takes advantage of falling through requests. So I think we can make this the default behavior without adding an extra option to re-enable it. I would like to see this implemented as well but as this is a breaking change let’s wait until @pleerock let’s us know if it’s a bug or a feature :D |
I just made a pull request (#223) which changes the default behavior to no-fallthrough, with an option to re-enable it. So, technically it's a breaking change, but it can be reverted per-server with a global option. |
okay, again we have issue with our |
When we remove next call, we have to build our own midleware stack handler to make after middlewares work. As now we are discussing the need of after middlewares in classic |
If we remove next call then I dont think we need after middleware... |
@soulski
|
I think koa router style is a good solution, according their code order, unless the first route has |
As anyone knows how to solve it? I'm facing the same problem and I don't know how to tell routing-controllers to not run both methods. |
@The-Firexx, It's been a really busy year-end so far and I've been tied up but as earlier as the 2nd week of 2020, I will create a milestone and organize the project board and we will start the issues and PRs prioritization and hopefully clean up at least the PRs queue which will allow us to set a baseline and start working on the open issues and feature requests. |
Stale issue message |
This has been fixed in #568. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I have one Controller which have 2 method like below
I run server and then send http request in path '/user'. The result in console log print follow below
and I receive response as json { say: 'user' }. I take a look at source code and found that after action was called, routing-controller call next method which I suspect it is the reason why 2 action which match path url call. I test by insert after after middleware that didn't call next. The result is only getByUser was called. Is this intend behavior? It use invoke only getByUser, is't it?
The text was updated successfully, but these errors were encountered: