{"action":"created","comment":{"url":"https://api.github.com/repos/nyaruka/courier/pulls/comments/220265297","pull_request_review_id":158633145,"id":220265297,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDI2NTI5Nw==","diff_hunk":"@@ -135,13 +135,11 @@ func newRRFromResponse(method string, requestTrace string, r *http.Response) (*R\n \t}\n \trr.Response = string(response)\n \n-\tif isText {\n-\t\tbodyBytes, err := ioutil.ReadAll(r.Body)\n-\t\tif err != nil {\n-\t\t\treturn &rr, err\n-\t\t}\n-\t\trr.Body = bodyBytes\n+\tbodyBytes, err := ioutil.ReadAll(r.Body)","path":"utils/http.go","position":10,"original_position":10,"commit_id":"b523da3cb4f148033780e157d52fa9c705f88a40","original_commit_id":"b523da3cb4f148033780e157d52fa9c705f88a40","user":{"login":"nicpottier","id":168067,"node_id":"MDQ6VXNlcjE2ODA2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/168067?v=4","gravatar_id":"","url":"https://api.github.com/users/nicpottier","html_url":"https://github.com/nicpottier","followers_url":"https://api.github.com/users/nicpottier/followers","following_url":"https://api.github.com/users/nicpottier/following{/other_user}","gists_url":"https://api.github.com/users/nicpottier/gists{/gist_id}","starred_url":"https://api.github.com/users/nicpottier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicpottier/subscriptions","organizations_url":"https://api.github.com/users/nicpottier/orgs","repos_url":"https://api.github.com/users/nicpottier/repos","events_url":"https://api.github.com/users/nicpottier/events{/privacy}","received_events_url":"https://api.github.com/users/nicpottier/received_events","type":"User","site_admin":false},"body":"In what way? It wasn't like we were returning an error previously when we got binary data, we just had an empty body, which seems just as likely to blow up as a binary body. All the handlers that are actually inspecting the body are parsing it in a way that should be just fine from that respect. (in that they will fail in the same way with an empty body as a binary body, such as parsing json for example) Do you have any specific example that show what you are worried about?","created_at":"2018-09-25T16:31:25Z","updated_at":"2018-09-25T16:31:25Z","html_url":"https://github.com/nyaruka/courier/pull/179#discussion_r220265297","pull_request_url":"https://api.github.com/repos/nyaruka/courier/pulls/179","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/comments/220265297"},"html":{"href":"https://github.com/nyaruka/courier/pull/179#discussion_r220265297"},"pull_request":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/179"}},"in_reply_to_id":220236545},"pull_request":{"url":"https://api.github.com/repos/nyaruka/courier/pulls/179","id":215954955,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1OTU0OTU1","html_url":"https://github.com/nyaruka/courier/pull/179","diff_url":"https://github.com/nyaruka/courier/pull/179.diff","patch_url":"https://github.com/nyaruka/courier/pull/179.patch","issue_url":"https://api.github.com/repos/nyaruka/courier/issues/179","number":179,"state":"open","locked":false,"title":"WhatsApp media handling","user":{"login":"smn","id":1065,"node_id":"MDQ6VXNlcjEwNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1065?v=4","gravatar_id":"","url":"https://api.github.com/users/smn","html_url":"https://github.com/smn","followers_url":"https://api.github.com/users/smn/followers","following_url":"https://api.github.com/users/smn/following{/other_user}","gists_url":"https://api.github.com/users/smn/gists{/gist_id}","starred_url":"https://api.github.com/users/smn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smn/subscriptions","organizations_url":"https://api.github.com/users/smn/orgs","repos_url":"https://api.github.com/users/smn/repos","events_url":"https://api.github.com/users/smn/events{/privacy}","received_events_url":"https://api.github.com/users/smn/received_events","type":"User","site_admin":false},"body":"This PR adds media support for WhatsApp in courier.\r\n\r\nThis is the first time I'm writing some golang so please let me know where I'm doing things in odd ways. \r\n\r\nI've been fighting with the test harness a bit since it was built around the idea that API interactions would be single request & response. WhatsApp breaks that a bit since the media upload is a 2 step interaction where a media file is exchanged for a media id. I've gone the route of allowing a list of requests that the test matches against to select the expected response. ","created_at":"2018-09-17T11:51:09Z","updated_at":"2018-09-25T16:31:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"950d598028f14992843fb683d955560543f3d600","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nyaruka/courier/pulls/179/commits","review_comments_url":"https://api.github.com/repos/nyaruka/courier/pulls/179/comments","review_comment_url":"https://api.github.com/repos/nyaruka/courier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nyaruka/courier/issues/179/comments","statuses_url":"https://api.github.com/repos/nyaruka/courier/statuses/b523da3cb4f148033780e157d52fa9c705f88a40","head":{"label":"smn:feature/whatsapp-media-handling","ref":"feature/whatsapp-media-handling","sha":"b523da3cb4f148033780e157d52fa9c705f88a40","user":{"login":"smn","id":1065,"node_id":"MDQ6VXNlcjEwNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1065?v=4","gravatar_id":"","url":"https://api.github.com/users/smn","html_url":"https://github.com/smn","followers_url":"https://api.github.com/users/smn/followers","following_url":"https://api.github.com/users/smn/following{/other_user}","gists_url":"https://api.github.com/users/smn/gists{/gist_id}","starred_url":"https://api.github.com/users/smn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smn/subscriptions","organizations_url":"https://api.github.com/users/smn/orgs","repos_url":"https://api.github.com/users/smn/repos","events_url":"https://api.github.com/users/smn/events{/privacy}","received_events_url":"https://api.github.com/users/smn/received_events","type":"User","site_admin":false},"repo":{"id":124067548,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQwNjc1NDg=","name":"courier","full_name":"smn/courier","private":false,"owner":{"login":"smn","id":1065,"node_id":"MDQ6VXNlcjEwNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1065?v=4","gravatar_id":"","url":"https://api.github.com/users/smn","html_url":"https://github.com/smn","followers_url":"https://api.github.com/users/smn/followers","following_url":"https://api.github.com/users/smn/following{/other_user}","gists_url":"https://api.github.com/users/smn/gists{/gist_id}","starred_url":"https://api.github.com/users/smn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smn/subscriptions","organizations_url":"https://api.github.com/users/smn/orgs","repos_url":"https://api.github.com/users/smn/repos","events_url":"https://api.github.com/users/smn/events{/privacy}","received_events_url":"https://api.github.com/users/smn/received_events","type":"User","site_admin":false},"html_url":"https://github.com/smn/courier","description":"A fast, GoLang message receiver and sender for SMS and IP channels","fork":true,"url":"https://api.github.com/repos/smn/courier","forks_url":"https://api.github.com/repos/smn/courier/forks","keys_url":"https://api.github.com/repos/smn/courier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smn/courier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smn/courier/teams","hooks_url":"https://api.github.com/repos/smn/courier/hooks","issue_events_url":"https://api.github.com/repos/smn/courier/issues/events{/number}","events_url":"https://api.github.com/repos/smn/courier/events","assignees_url":"https://api.github.com/repos/smn/courier/assignees{/user}","branches_url":"https://api.github.com/repos/smn/courier/branches{/branch}","tags_url":"https://api.github.com/repos/smn/courier/tags","blobs_url":"https://api.github.com/repos/smn/courier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smn/courier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smn/courier/git/refs{/sha}","trees_url":"https://api.github.com/repos/smn/courier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smn/courier/statuses/{sha}","languages_url":"https://api.github.com/repos/smn/courier/languages","stargazers_url":"https://api.github.com/repos/smn/courier/stargazers","contributors_url":"https://api.github.com/repos/smn/courier/contributors","subscribers_url":"https://api.github.com/repos/smn/courier/subscribers","subscription_url":"https://api.github.com/repos/smn/courier/subscription","commits_url":"https://api.github.com/repos/smn/courier/commits{/sha}","git_commits_url":"https://api.github.com/repos/smn/courier/git/commits{/sha}","comments_url":"https://api.github.com/repos/smn/courier/comments{/number}","issue_comment_url":"https://api.github.com/repos/smn/courier/issues/comments{/number}","contents_url":"https://api.github.com/repos/smn/courier/contents/{+path}","compare_url":"https://api.github.com/repos/smn/courier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smn/courier/merges","archive_url":"https://api.github.com/repos/smn/courier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smn/courier/downloads","issues_url":"https://api.github.com/repos/smn/courier/issues{/number}","pulls_url":"https://api.github.com/repos/smn/courier/pulls{/number}","milestones_url":"https://api.github.com/repos/smn/courier/milestones{/number}","notifications_url":"https://api.github.com/repos/smn/courier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smn/courier/labels{/name}","releases_url":"https://api.github.com/repos/smn/courier/releases{/id}","deployments_url":"https://api.github.com/repos/smn/courier/deployments","created_at":"2018-03-06T11:19:35Z","updated_at":"2018-09-19T15:33:44Z","pushed_at":"2018-09-25T12:42:36Z","git_url":"git://github.com/smn/courier.git","ssh_url":"git@github.com:smn/courier.git","clone_url":"https://github.com/smn/courier.git","svn_url":"https://github.com/smn/courier","homepage":null,"size":5904,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nyaruka:master","ref":"master","sha":"f41d63f4a89614422dacec3d077c9938db07ca2d","user":{"login":"nyaruka","id":299256,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5OTI1Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"repo":{"id":90886480,"node_id":"MDEwOlJlcG9zaXRvcnk5MDg4NjQ4MA==","name":"courier","full_name":"nyaruka/courier","private":false,"owner":{"login":"nyaruka","id":299256,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5OTI1Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/299256?v=4","gravatar_id":"","url":"https://api.github.com/users/nyaruka","html_url":"https://github.com/nyaruka","followers_url":"https://api.github.com/users/nyaruka/followers","following_url":"https://api.github.com/users/nyaruka/following{/other_user}","gists_url":"https://api.github.com/users/nyaruka/gists{/gist_id}","starred_url":"https://api.github.com/users/nyaruka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyaruka/subscriptions","organizations_url":"https://api.github.com/users/nyaruka/orgs","repos_url":"https://api.github.com/users/nyaruka/repos","events_url":"https://api.github.com/users/nyaruka/events{/privacy}","received_events_url":"https://api.github.com/users/nyaruka/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nyaruka/courier","description":"A fast, GoLang message receiver and sender for SMS and IP channels","fork":false,"url":"https://api.github.com/repos/nyaruka/courier","forks_url":"https://api.github.com/repos/nyaruka/courier/forks","keys_url":"https://api.github.com/repos/nyaruka/courier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyaruka/courier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyaruka/courier/teams","hooks_url":"https://api.github.com/repos/nyaruka/courier/hooks","issue_events_url":"https://api.github.com/repos/nyaruka/courier/issues/events{/number}","events_url":"https://api.github.com/repos/nyaruka/courier/events","assignees_url":"https://api.github.com/repos/nyaruka/courier/assignees{/user}","branches_url":"https://api.github.com/repos/nyaruka/courier/branches{/branch}","tags_url":"https://api.github.com/repos/nyaruka/courier/tags","blobs_url":"https://api.github.com/repos/nyaruka/courier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyaruka/courier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyaruka/courier/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyaruka/courier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyaruka/courier/statuses/{sha}","languages_url":"https://api.github.com/repos/nyaruka/courier/languages","stargazers_url":"https://api.github.com/repos/nyaruka/courier/stargazers","contributors_url":"https://api.github.com/repos/nyaruka/courier/contributors","subscribers_url":"https://api.github.com/repos/nyaruka/courier/subscribers","subscription_url":"https://api.github.com/repos/nyaruka/courier/subscription","commits_url":"https://api.github.com/repos/nyaruka/courier/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyaruka/courier/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyaruka/courier/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyaruka/courier/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyaruka/courier/contents/{+path}","compare_url":"https://api.github.com/repos/nyaruka/courier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyaruka/courier/merges","archive_url":"https://api.github.com/repos/nyaruka/courier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyaruka/courier/downloads","issues_url":"https://api.github.com/repos/nyaruka/courier/issues{/number}","pulls_url":"https://api.github.com/repos/nyaruka/courier/pulls{/number}","milestones_url":"https://api.github.com/repos/nyaruka/courier/milestones{/number}","notifications_url":"https://api.github.com/repos/nyaruka/courier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyaruka/courier/labels{/name}","releases_url":"https://api.github.com/repos/nyaruka/courier/releases{/id}","deployments_url":"https://api.github.com/repos/nyaruka/courier/deployments","created_at":"2017-05-10T16:38:44Z","updated_at":"2018-09-13T16:14:45Z","pushed_at":"2018-09-25T12:42:37Z","git_url":"git://github.com/nyaruka/courier.git","ssh_url":"git@github.com:nyaruka/courier.git","clone_url":"https://github.com/nyaruka/courier.git","svn_url":"https://github.com/nyaruka/courier","homepage":null,"size":5871,"stargazers_count":41,"watchers_count":41,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":16,"open_issues":6,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/179"},"html":{"href":"https://github.com/nyaruka/courier/pull/179"},"issue":{"href":"https://api.github.com/repos/nyaruka/courier/issues/179"},"comments":{"href":"https://api.github.com/repos/nyaruka/courier/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nyaruka/courier/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/nyaruka/courier/statuses/b523da3cb4f148033780e157d52fa9c705f88a40"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nicpottier"}}