coreh / hookshot

Hookshot is a tiny library and companion CLI tool for handling GitHub post-receive hooks.
MIT License
145 stars 24 forks source link

Fix main POST handler #5

Closed valscion closed 10 years ago

valscion commented 10 years ago

The express.bodyParser() already converts a JSON response to a populated object on req.body.

Hookshot crashed always when receiving a payload, because it tried to parse "undefined" with JSON.parse, failing SyntaxError: Unexpected token u on line 15.

kdbanman commented 10 years ago

+1. I discovered the same bug. This fix rectified it completely.

konklone commented 10 years ago

This fixes it for me too. @VesQ, thanks for doing this -- I'm going to use your fork until this is merged.

coreh commented 10 years ago

Sorry for the delay. Didn't see the original notifications. I was using x-www-form-urlencoded payloads, so that's why I didn't hit this. Merging.

konklone commented 10 years ago

Thank you!