Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Fix status behavior in endpoint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Bin committed Dec 16, 2015
1 parent b5f4134 commit 03d4829
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ This can be completely overridden with the `status` property, e.g.:
path: '/feature/:foo?',
status: function(req, res) {
if(req.params.foo === '999') {
res.send(404).body('Feature not found');
res.status(404).send('Feature not found');
}
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var generate = function(req, res, next) {

if(_.isFunction(service.status)) {
service.status.apply(service, arguments);
return res.end();
}

if(!(service.cache && cache[path])) {
Expand Down

0 comments on commit 03d4829

Please sign in to comment.