Skip to content
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

filter the request if the request.body is invalid #8

Merged
merged 1 commit into from
Apr 3, 2016
Merged

Conversation

yorkie
Copy link
Member

@yorkie yorkie commented Apr 2, 2016

This fixes #7

@yorkie
Copy link
Member Author

yorkie commented Apr 2, 2016

@koajs/body-parsing @coderhaoxin may I ask someone help me this review, thanks :-)

@@ -25,7 +25,8 @@ module.exports = function * (next) {

yield * next;

if (this.method != 'GET') {
if (this.method != 'GET' ||
this.body == undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfer this.body == null, but NVM :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you

@haoxins
Copy link
Member

haoxins commented Apr 2, 2016

LGTM

@yorkie yorkie merged commit d305fc7 into master Apr 3, 2016
@yorkie yorkie deleted the fix/gh-7 branch April 3, 2016 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Giving an error with empty body
2 participants