Permalink
Browse files

Set status with numbers via koa#298

  • Loading branch information...
1 parent e0570d1 commit 8402cddd7f002fb2bea4fcd725af26bcf857e9f7 @benjreinhart benjreinhart committed Jun 16, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 components/search/middleware/enforce_query.js
  2. +1 −1 components/search/middleware/parse_query.js
View
2 components/search/middleware/enforce_query.js
@@ -12,6 +12,6 @@ exports.enforceQuery = function *(next) {
yield next;
else {
this.body = {error: 'query is required'};
- this.status = 'bad request';
+ this.status = 400;
}
}
View
2 components/search/middleware/parse_query.js
@@ -12,7 +12,7 @@ exports.parseQuery = function *(next) {
this.request.body.query = Parser.parse(this.request.body.query);
} catch (e) {
this.body = {error: 'malformed search'};
- this.status = 'bad request';
+ this.status = 400;
return
}
yield next;

0 comments on commit 8402cdd

Please sign in to comment.