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

Doesn't work anymore, gith expects a different format of data. #27

Open
ssmereka opened this issue Apr 1, 2015 · 2 comments
Open

Doesn't work anymore, gith expects a different format of data. #27

ssmereka opened this issue Apr 1, 2015 · 2 comments

Comments

@ssmereka
Copy link

ssmereka commented Apr 1, 2015

Does this library even still work for anyone? In version 1.04 I am able to receiving POSTs from github webhooks, but they all seem to be failing this payload regular expression test.

req.on( "end", function() {
      if ( /^payload=/.test( data ) ) {
        var payload = JSON.parse( querystring.unescape(data.slice(8)) );
        eventaur.emit( "payload", payload );
        res.writeHead( 200, {
          'Content-type': 'text/html'
        });
      }
      res.end();
    });

However if I edit gith to just expect the payload and not playload={ /* data */ }, then it works.

req.on( "end", function() {
    var payload;
    try {
        payload = JSON.parse( data );
        eventaur.emit( "payload", payload );
        res.writeHead( 200, {
            'Content-type': 'text/html'
        });
    } catch(err) { 
        console.log(err);
    }
    res.end();
});

Has anyone else had issues?

@lklepner
Copy link

lklepner commented Apr 2, 2015

It wasn't working for me either. Implementing the changes you put forward fixed it. Many thanks!

amaline added a commit to amaline/gith that referenced this issue Aug 7, 2015
@AddoSolutions
Copy link

Same here

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

3 participants