-
Notifications
You must be signed in to change notification settings - Fork 84
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
Express Connect Middleware does not call next()
for handled requests
#551
Comments
Thanks for the issue, Milan, we'll get this fixed. |
@timostamm I can try to put in a PR, if you'd like. I am, however, not that proficient with express to judge if what I'm asking is indeed the correct pattern to go for. |
Hi @easyCZ, in looking at this and Express documentation, I think our middleware is behaving according to Express semantics. If you look at the docs here (4th section), it says:
Our middleware does end the request-response cycle (unless a route isn't found for a specific request) so I think it's working correctly here. I understand what you're asking though. What about using a basic middleware function in addition to ours that added an event listener to the
|
@easyCZ going to close this issue but feel free to re-open or create a new one if you notice something still not working correctly. |
Describe the bug
In the implementation of the express connect middleware, the middleware only calls
next()
when it does not find a corresponding registered connect handler.However, it should also call
next()
after it finds an appropriate handler, and handles the request. This then allows any registered middlewares afterwards to also run. This is useful for any number of use-cases, such as logging, telemetry, etc and in the absence ofit is the only way to actually get some telemetry out after the request has been handled.
To Reproduce
If you encountered an error message, please copy and paste it verbatim.
If the bug is specific to an RPC or payload, please provide a reduced
example.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: