-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
#415 Missing body for POST request in middleware #576
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
Conversation
Added body parser to server defaults.
test/cli/index.js
Outdated
serverReady(PORT, done) | ||
}) | ||
|
||
it('Should have post body in middleware', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: lowcase "s" in "should"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the line, and also updated the code to the new standards. Is it okay to get accepted now? I'd love to have this in the next release.
Capitol letter is now lower case
Added body parser to server defaults.
Capitol letter is now lower case
Any chance to accept this pull request so we can move on from version 0.8.23? |
Hi Sorry for the delay, and thank you for the PR, AFAIR I think it was removed on purpose, because it was conflicting in some cases when the project was used as a module in another Express app (can't remember the issue). If the idea is to make it available to middlewares loaded by the CLI, would it be possible to make it an option of |
Added body parser to server defaults.
Capitol letter is now lower case
Added body parser to server defaults.
Conflicts: test/cli/fixtures/middlewares/postbody.js test/cli/index.js
I've just updated the code that I think you meant for it to be, could you take a look at it? |
Thank you! |
@typicode Do you know when these changes will be released? |
@andys8 Thanks for the reminder, today :) |
Released 👍 |
Awesome, @typicode ! |
So to be clear, I'm using it in this way:
|
As described in issue 415, the body of post requests was no longer available in middlewares, since version 0.9.0.
The issue was caused by the removal of the 'body-parser' from the server/defaults.js. After re-adding this parser there, the body became available again in the middleware. I've also added an extra test, to verify that the post body is indeed available in the middleware, to prevent future changes to break this again,