Skip to content

Commit

Permalink
mod upload fields
Browse files Browse the repository at this point in the history
  • Loading branch information
RocksonZeta committed Nov 20, 2014
1 parent e76e1ef commit 47f3eec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = function() {
return function * (next) {
debug('init koa-validate');
this.checkBody = function(key) {
return new Validator(this, key, this.request.body[key], key in this.request.body , this.request.body );
var body = this.request.body.fields || this.request.body; // koa-body fileds
return new Validator(this, key, body[key], key in body , body );
};
this.checkQuery = function(key) {
return new Validator(this, key, this.request.query[key], key in this.request.query,this.request.query );
Expand Down

0 comments on commit 47f3eec

Please sign in to comment.