Currently, if an upstream middleware consumes http(s).ServerRequest's message body events and valid json/form header are set then bodyParser will never complete it's attempt at getting the message body. This update allows earlier middleware to set req.rawBody, which will be used instead, avoiding the hang and allowing consumption and manipulation of the message body prior to parsing by bodyParser.
I noticed that as of the 10th, rawBody was removed. If desired, rawBody could be unset by bodyParser after parsing.
Added support for setting of req.rawBody by upstream middleware witho…
…ut interfering with bodyParser's duties.
I dont think we really need to complicate it, it's easy enough to just use JSON.parse etc directly (though if you wanted to you could still use connect.bodyParser.parse[mime]
The idea is to consolidate concerns. Yes, one could call the needed parsers directly, but either you end up doing ALL the parsing in the new middleware or you end up with parsing happening in multiple locations. Why write/maintain your own parsing middleware when connect provides a great one already?