-
Notifications
You must be signed in to change notification settings - Fork 24
fix body-parser middleware stream issue #104
Conversation
Hopefully someone will get back to me and let me know of a better fix. 👍 |
Hey! This looks good, but I'm wondering in which scenarios Looks like the fix at this level is just trying to hide another issue somewhere else. A body which is different from those data types should never reach that part of the forward middleware logic. I'm curious why the body is an empty object. |
Thank you for following up on this! It's most appreciated, as we would need to at least have this fix in order to deliver a solution we're presently working on. I'm not sure it would ever be an instanceof Buffer either, but from what I've read, only strings, Buffers, or a null may be pushed onto a Readable stream:
In my particular scenario, since I am using some additional body-parser middleware, req.body is set to be an empty JS object:
We're using this middleware because it's needed by passport-saml, which we're using for SAML authentication to protect our API. The commit makes sense to me in that yes, it does protect Rocky from blowing up in this scenario, but I'm still wondering if there's maybe something that should be added. |
That makes sense. I don't have time to dig into details and come up with a stronger solution, so I'm going to merge this and release a new version. |
Thanks for doing this. A great help for our project! I'll go ahead and close #102 |
|
Confirmed:
Thanks, @h2non! |
#102