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

Request.input should not allow 0 arguments #885

Merged
merged 2 commits into from
Jul 1, 2019
Merged

Request.input should not allow 0 arguments #885

merged 2 commits into from
Jul 1, 2019

Conversation

swantzter
Copy link
Contributor

Request.input has a check at L1150 where it's supposed to ensure that at least two parameters are passed to the function, however it only checks if (arguments.length === 1) { and thus calling the function without any arguments passes this test throwing a TypeError at L1170 instead of an EARGS error like expected. example

What this does: Changes behavour to throw if 1 or fewer arguments provided

`Request.input` has a check at [L1150](https://github.com/tediousjs/node-mssql/blob/41f374105f048a5a4fc682b88bc0a431104fae89/lib/base.js#L1150) where it's supposed to ensure that at least two parameters are passed to the function, however it only checks `if (arguments.length === 1) {` and thus calling the function without any arguments passes this test throwing a TypeError at L1170 instead of an EARGS error like expected. [example](https://runkit.com/swant/mssql-request-input-doesn-t-throw-properly)
lib/base.js Outdated Show resolved Hide resolved
Co-Authored-By: Will Morgan <willmorgan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants