Skip to content

Commit

Permalink
Merge pull request #2756 from jub3i/patch-3
Browse files Browse the repository at this point in the history
req.param() is broken for boolean false params
  • Loading branch information
mikermcneil committed Mar 31, 2015
2 parents 14be847 + f0cf3b3 commit 2141ef0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/router/req.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ module.exports = function buildRequest (_req) {

// Grab the value of the parameter from the appropriate place
// and return it
return params[paramName] || defaultValue;
if (typeof params[paramName] !== 'undefined') {
return params[paramName];
} else {
return defaultValue;
}

},
wantsJSON: (_req && _req.wantsJSON) || true,
method: 'GET'
Expand Down

0 comments on commit 2141ef0

Please sign in to comment.