pmlopes / yoke

Yoke is a middleware framework for Vert.x
http://pmlopes.github.io/yoke/
Apache License 2.0
157 stars 44 forks source link

Commit 3475ebd7ad breaks the BodyParser middleware #115

Closed XiaochunLU closed 10 years ago

XiaochunLU commented 10 years ago

This commit made a change to run middleware on context to avoid blocking the event loop. But BodyParser registers dataHandler/endHandler on incoming request, which must be ensured that the handlers are registered before the request body is received/read. If the BodyParser is ran on a context explicitly, it would be executed async, and 99% of the chances the request body is received/read before BodyParser is handled, hence the dataHandler/endHandler will never be invoked. As a result, POST request with form parameters will hang in BodyParser. The next middleware will not been handled because the next.handle(null) is in endHandler, which is not invoked.

pmlopes commented 10 years ago

Thanks for spotting that!