Skip to content

Added optional request object in validateFunc #33

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

Closed
wants to merge 1 commit into from
Closed

Added optional request object in validateFunc #33

wants to merge 1 commit into from

Conversation

ck-lee
Copy link
Contributor

@ck-lee ck-lee commented Jun 21, 2015

My first PR & contribution to hapijs. Let me know if this works. Otherwise, I'm happy to make further changes to make it right...

closes #30

@hueniverse hueniverse changed the title Added optional request object in validateFunc. closes #30 Added optional request object in validateFunc Jun 21, 2015
@hueniverse
Copy link
Contributor

Can't rely on number of arguments in a callback function. People can (and often do) implement functions in all sorts of ways in JS including using arguments instead of actual arguments, or add extra arguments so that a method can be shared between multiple APIs.

This needs to be a breaking change the same way it was done in hapi-auth-cookie.

@hueniverse hueniverse added the feature New functionality or improvement label Jun 21, 2015
@ck-lee
Copy link
Contributor Author

ck-lee commented Jun 21, 2015

Looking into the the code for hapi-auth-cookie. https://github.com/hapijs/hapi-auth-cookie/blob/master/lib/index.js#L133-150

Let me know if you would like to implement this change for next release and what other things to watch out for. I'm quite happy to do it.

@hueniverse
Copy link
Contributor

Basically just add request as the first argument passed to the callback along with some new tests to confirm it is there. I will then publish a new major version. Pretty simple.

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request : request object inside the validation function
2 participants