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.
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.