Skip to content

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

@kyleolsondesign

Description

@kyleolsondesign

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', ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions