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

req.param() is broken for falsey params #2756

Merged
merged 1 commit into from
Mar 31, 2015
Merged

req.param() is broken for falsey params #2756

merged 1 commit into from
Mar 31, 2015

Conversation

jub3i
Copy link
Member

@jub3i jub3i commented Mar 17, 2015

for example if you posted data { isPirate: false } and you run req.param('isPirate') from a controller, you'd get undefined returned as you didn't specify a defaultValue - so basically you couldn't post params that where === false. I think this edit captures the spirit of the OR guard used previously. If your happy with this, I would be ok with writing a test... if needed.

for example if you posted data `{ isPirate: false }` and you run `req.param('isPirate')` from a controller, you'd get `undefined` returned as you didn't specify a `defaultValue` - so basically you couldn't post params that where === false. I think this edit captures the spirit of the OR guard used previously.
@jub3i jub3i changed the title Update req.js req.param() is broken Mar 17, 2015
@jub3i
Copy link
Member Author

jub3i commented Mar 17, 2015

if anyone is interested a temporary workaround for this: instead of using req.param('myParamName') you would use req.allParams().myParamName

@jub3i jub3i changed the title req.param() is broken req.param() is broken for boolean false params Mar 17, 2015
@enkows
Copy link
Contributor

enkows commented Mar 29, 2015

+1

@mikermcneil
Copy link
Member

Thanks @jub3i!

mikermcneil added a commit that referenced this pull request Mar 31, 2015
req.param() is broken for boolean false params
@mikermcneil mikermcneil merged commit 2141ef0 into balderdashy:master Mar 31, 2015
@jub3i jub3i changed the title req.param() is broken for boolean false params req.param() is broken for falsey params May 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants