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

Using secret as function does not receive data payload as documented #42

Open
kyleolsondesign opened this issue Dec 20, 2017 · 0 comments

Comments

@kyleolsondesign
Copy link

In the readme it clearly states that there are three arguments sent to the secret option when it is defined as a function:

this option can also be a function that takes the following parameters: (request, data, callback).

But the actual code only ever sends the request object and the callback:

    if (typeof this.secret === 'function') {
        return this.secret(req, next);
    }

https://github.com/nlf/node-github-hook/blob/master/index.js#L278

The data is not available in that scope, as it's not passed to the getSecret method:

        self.getSecret(req, function (err, secret) {

https://github.com/nlf/node-github-hook/blob/master/index.js#L88

But it is clearly available at that time, as that method is called after req.on('end', ...).

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

No branches or pull requests

1 participant