{"action":"created","issue":{"url":"https://api.github.com/repos/github/hubot/issues/1056","labels_url":"https://api.github.com/repos/github/hubot/issues/1056/labels{/name}","comments_url":"https://api.github.com/repos/github/hubot/issues/1056/comments","events_url":"https://api.github.com/repos/github/hubot/issues/1056/events","html_url":"https://github.com/github/hubot/pull/1056","id":108281210,"number":1056,"title":"Add a rawBody property to req object in custom HTTP listeners","user":{"login":"brodul","id":204514,"avatar_url":"https://avatars.githubusercontent.com/u/204514?v=3","gravatar_id":"","url":"https://api.github.com/users/brodul","html_url":"https://github.com/brodul","followers_url":"https://api.github.com/users/brodul/followers","following_url":"https://api.github.com/users/brodul/following{/other_user}","gists_url":"https://api.github.com/users/brodul/gists{/gist_id}","starred_url":"https://api.github.com/users/brodul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brodul/subscriptions","organizations_url":"https://api.github.com/users/brodul/orgs","repos_url":"https://api.github.com/users/brodul/repos","events_url":"https://api.github.com/users/brodul/events{/privacy}","received_events_url":"https://api.github.com/users/brodul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-25T08:05:36Z","updated_at":"2015-10-20T20:44:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/github/hubot/pulls/1056","html_url":"https://github.com/github/hubot/pull/1056","diff_url":"https://github.com/github/hubot/pull/1056.diff","patch_url":"https://github.com/github/hubot/pull/1056.patch"},"body":"Hello,\r\n\r\nI modified the express middleware that is used in custom HTTP listeners (routers) so that a hubot user can access the actual body of the request as a string object. \r\n\r\nThe need for this is described in #923 . It's probably impossible to access the unprocessed body without monkey-patching hubot itself.\r\n\r\nI need this for validating github webhooks that use HMAC.\r\nI added an example in the documentation how to do this.\r\n\r\nAccessing the body in express 3.x and testing middlewares is hard. After trying different approaches I decided to implement this solution: http://stackoverflow.com/a/26634372/807339 .\r\n\r\nMocha has a hard time detecting assert errors inside routers in the test cases. Therefore I had to rethrow them in the test context/namespace.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/github/hubot/issues/comments/149696489","html_url":"https://github.com/github/hubot/pull/1056#issuecomment-149696489","issue_url":"https://api.github.com/repos/github/hubot/issues/1056","id":149696489,"user":{"login":"brodul","id":204514,"avatar_url":"https://avatars.githubusercontent.com/u/204514?v=3","gravatar_id":"","url":"https://api.github.com/users/brodul","html_url":"https://github.com/brodul","followers_url":"https://api.github.com/users/brodul/followers","following_url":"https://api.github.com/users/brodul/following{/other_user}","gists_url":"https://api.github.com/users/brodul/gists{/gist_id}","starred_url":"https://api.github.com/users/brodul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brodul/subscriptions","organizations_url":"https://api.github.com/users/brodul/orgs","repos_url":"https://api.github.com/users/brodul/repos","events_url":"https://api.github.com/users/brodul/events{/privacy}","received_events_url":"https://api.github.com/users/brodul/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T20:44:44Z","updated_at":"2015-10-20T20:44:44Z","body":"HI,\r\n\r\nhere is some :cake: :smile:"}}