{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/86692951","pull_request_review_id":7338384,"id":86692951,"diff_hunk":"@@ -7,6 +7,8 @@ module.exports = (context) => {\n \n         end: (body) => {\n             if (body !== undefined) {\n+                if (Buffer.isBuffer(body) && !res.get('Content-Type'))","path":"src/WebJobs.Script/Content/Script/http/response.js","position":4,"original_position":4,"commit_id":"5cd39bbf7cfe22b41e5528a8d88e9b2d35df6748","original_commit_id":"5cd39bbf7cfe22b41e5528a8d88e9b2d35df6748","user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"body":"Also, I'd hoist this out into a helper function:\r\n\r\n```javascript\r\nfunction setContentType(res) {\r\n  if (!res.get['Content-Type'])) {\r\n    // don't default the content type if it was set explicitly\r\n    return;\r\n  }\r\n\r\n  if (Buffer.isBuffer(res.body) {\r\n    res.type('application/octet-stream');\r\n  }\r\n}\r\n```","created_at":"2016-11-06T18:47:12Z","updated_at":"2016-11-06T18:47:12Z","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871#discussion_r86692951","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/86692951"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871#discussion_r86692951"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871","id":92240642,"html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871","diff_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/871","number":871,"state":"open","locked":false,"title":"Added buffer support to Node","user":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"body":"Using System.Dynamic instead of json.net as that's what edgejs operates upon, which helps to maintain type info.\r\n\r\nresolves #814 ","created_at":"2016-11-03T21:09:05Z","updated_at":"2016-11-06T18:47:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbe36c7186789e248270ef5c57aa7d7e1f1e5947","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/871/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/5cd39bbf7cfe22b41e5528a8d88e9b2d35df6748","head":{"label":"mamaso:buffers","ref":"buffers","sha":"5cd39bbf7cfe22b41e5528a8d88e9b2d35df6748","user":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"repo":{"id":67830971,"name":"azure-webjobs-sdk-script","full_name":"mamaso/azure-webjobs-sdk-script","owner":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mamaso/azure-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":true,"url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/deployments","created_at":"2016-09-09T20:34:18Z","updated_at":"2016-09-09T20:34:20Z","pushed_at":"2016-11-04T00:25:49Z","git_url":"git://github.com/mamaso/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:mamaso/azure-webjobs-sdk-script.git","clone_url":"https://github.com/mamaso/azure-webjobs-sdk-script.git","svn_url":"https://github.com/mamaso/azure-webjobs-sdk-script","homepage":"","size":16514,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"5d0c6b1bd31594d44a880fd4e709349c93186797","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":42548553,"name":"azure-webjobs-sdk-script","full_name":"Azure/azure-webjobs-sdk-script","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/deployments","created_at":"2015-09-15T21:48:19Z","updated_at":"2016-11-06T00:13:54Z","pushed_at":"2016-11-05T00:48:45Z","git_url":"git://github.com/Azure/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk-script.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk-script.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk-script","homepage":"","size":17280,"stargazers_count":156,"watchers_count":156,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":154,"forks":62,"open_issues":154,"watchers":156,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/871"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/871"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/871/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/871/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/5cd39bbf7cfe22b41e5528a8d88e9b2d35df6748"}}}}
{"actor":{"display_login":"mathewc"}}