Skip to content
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

Calling next twice inside a route handler #2759

Closed
merpnderp opened this issue Sep 21, 2015 · 4 comments
Closed

Calling next twice inside a route handler #2759

merpnderp opened this issue Sep 21, 2015 · 4 comments
Assignees

Comments

@merpnderp
Copy link

I had a bug where I had a chain of middleware and accidentally called next() twice inside a single middleware. This caused the next middleware, which was async in nature, to be ignored since the handler after that was the final route handler.

Perhaps it would be nice to only allow a middleware to call next() once and throw an error after that?

Just wanted to bring this to the maintainers attention to make sure this is functionality that is desired.

@dougwilson
Copy link
Contributor

Hi! Yes, we want to add that validation, but are unable to in 4.x because for whatever reason people are abusing that currently. We plan to validate this in 5.x

@dougwilson dougwilson self-assigned this Sep 21, 2015
@dougwilson
Copy link
Contributor

Existing discussion on this topic is here: #2701

@merpnderp
Copy link
Author

https://xkcd.com/1172/

@dougwilson
Copy link
Contributor

@merpnderp :) Sadly, that is pretty accurate for projects with extreme user bases :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants