{"action":"created","comment":{"url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/comments/69308326","id":69308326,"diff_hunk":"@@ -798,6 +798,10 @@ module.exports = function (options) {\n     if (!_.contains(args.fileType, 'image')) return done(null, {ok: false, why: 'Avatar upload: file must be an image.'});\n     if (file.length > 5242880) return done(null, {ok: false, why: 'Avatar upload: max file size of 5MB exceeded.'});\n \n+    var buf = new Buffer(file, 'base64');\n+    var type = buf.toString('hex', 0, 4);\n+    if (type !== 'ffd8ffe0' && type !== '89504e47' && type !== '47494638') return done(null, {ok: false, why: 'Avatar upload: file must be an image of type png, jpeg or gif.'});","path":"profiles.js","position":6,"original_position":6,"commit_id":"19e906e5d81ef1fe2ba7f83dbaeb771809f44954","original_commit_id":"19e906e5d81ef1fe2ba7f83dbaeb771809f44954","user":{"login":"Wardormeur","id":1755357,"avatar_url":"https://avatars.githubusercontent.com/u/1755357?v=3","gravatar_id":"","url":"https://api.github.com/users/Wardormeur","html_url":"https://github.com/Wardormeur","followers_url":"https://api.github.com/users/Wardormeur/followers","following_url":"https://api.github.com/users/Wardormeur/following{/other_user}","gists_url":"https://api.github.com/users/Wardormeur/gists{/gist_id}","starred_url":"https://api.github.com/users/Wardormeur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wardormeur/subscriptions","organizations_url":"https://api.github.com/users/Wardormeur/orgs","repos_url":"https://api.github.com/users/Wardormeur/repos","events_url":"https://api.github.com/users/Wardormeur/events{/privacy}","received_events_url":"https://api.github.com/users/Wardormeur/received_events","type":"User","site_admin":false},"body":"Cannot this be spoofed? ","created_at":"2016-07-01T14:33:53Z","updated_at":"2016-07-01T14:33:53Z","html_url":"https://github.com/CoderDojo/cp-users-service/pull/202#discussion_r69308326","pull_request_url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/comments/69308326"},"html":{"href":"https://github.com/CoderDojo/cp-users-service/pull/202#discussion_r69308326"},"pull_request":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202","id":75988150,"html_url":"https://github.com/CoderDojo/cp-users-service/pull/202","diff_url":"https://github.com/CoderDojo/cp-users-service/pull/202.diff","patch_url":"https://github.com/CoderDojo/cp-users-service/pull/202.patch","issue_url":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/202","number":202,"state":"open","locked":false,"title":"check if image is jpeg, png or gif","user":{"login":"butlerx","id":867930,"avatar_url":"https://avatars.githubusercontent.com/u/867930?v=3","gravatar_id":"","url":"https://api.github.com/users/butlerx","html_url":"https://github.com/butlerx","followers_url":"https://api.github.com/users/butlerx/followers","following_url":"https://api.github.com/users/butlerx/following{/other_user}","gists_url":"https://api.github.com/users/butlerx/gists{/gist_id}","starred_url":"https://api.github.com/users/butlerx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butlerx/subscriptions","organizations_url":"https://api.github.com/users/butlerx/orgs","repos_url":"https://api.github.com/users/butlerx/repos","events_url":"https://api.github.com/users/butlerx/events{/privacy}","received_events_url":"https://api.github.com/users/butlerx/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-01T14:28:01Z","updated_at":"2016-07-01T14:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0776cf8e159b6399af1aeb28500ab180330523b0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202/commits","review_comments_url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202/comments","review_comment_url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/202/comments","statuses_url":"https://api.github.com/repos/CoderDojo/cp-users-service/statuses/19e906e5d81ef1fe2ba7f83dbaeb771809f44954","head":{"label":"butlerx:image-check","ref":"image-check","sha":"19e906e5d81ef1fe2ba7f83dbaeb771809f44954","user":{"login":"butlerx","id":867930,"avatar_url":"https://avatars.githubusercontent.com/u/867930?v=3","gravatar_id":"","url":"https://api.github.com/users/butlerx","html_url":"https://github.com/butlerx","followers_url":"https://api.github.com/users/butlerx/followers","following_url":"https://api.github.com/users/butlerx/following{/other_user}","gists_url":"https://api.github.com/users/butlerx/gists{/gist_id}","starred_url":"https://api.github.com/users/butlerx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butlerx/subscriptions","organizations_url":"https://api.github.com/users/butlerx/orgs","repos_url":"https://api.github.com/users/butlerx/repos","events_url":"https://api.github.com/users/butlerx/events{/privacy}","received_events_url":"https://api.github.com/users/butlerx/received_events","type":"User","site_admin":false},"repo":{"id":55306213,"name":"cp-users-service","full_name":"butlerx/cp-users-service","owner":{"login":"butlerx","id":867930,"avatar_url":"https://avatars.githubusercontent.com/u/867930?v=3","gravatar_id":"","url":"https://api.github.com/users/butlerx","html_url":"https://github.com/butlerx","followers_url":"https://api.github.com/users/butlerx/followers","following_url":"https://api.github.com/users/butlerx/following{/other_user}","gists_url":"https://api.github.com/users/butlerx/gists{/gist_id}","starred_url":"https://api.github.com/users/butlerx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butlerx/subscriptions","organizations_url":"https://api.github.com/users/butlerx/orgs","repos_url":"https://api.github.com/users/butlerx/repos","events_url":"https://api.github.com/users/butlerx/events{/privacy}","received_events_url":"https://api.github.com/users/butlerx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/butlerx/cp-users-service","description":"This is the users service, a backend repository of the CoderDojo Zen Community Platform project.","fork":true,"url":"https://api.github.com/repos/butlerx/cp-users-service","forks_url":"https://api.github.com/repos/butlerx/cp-users-service/forks","keys_url":"https://api.github.com/repos/butlerx/cp-users-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/butlerx/cp-users-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/butlerx/cp-users-service/teams","hooks_url":"https://api.github.com/repos/butlerx/cp-users-service/hooks","issue_events_url":"https://api.github.com/repos/butlerx/cp-users-service/issues/events{/number}","events_url":"https://api.github.com/repos/butlerx/cp-users-service/events","assignees_url":"https://api.github.com/repos/butlerx/cp-users-service/assignees{/user}","branches_url":"https://api.github.com/repos/butlerx/cp-users-service/branches{/branch}","tags_url":"https://api.github.com/repos/butlerx/cp-users-service/tags","blobs_url":"https://api.github.com/repos/butlerx/cp-users-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/butlerx/cp-users-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/butlerx/cp-users-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/butlerx/cp-users-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/butlerx/cp-users-service/statuses/{sha}","languages_url":"https://api.github.com/repos/butlerx/cp-users-service/languages","stargazers_url":"https://api.github.com/repos/butlerx/cp-users-service/stargazers","contributors_url":"https://api.github.com/repos/butlerx/cp-users-service/contributors","subscribers_url":"https://api.github.com/repos/butlerx/cp-users-service/subscribers","subscription_url":"https://api.github.com/repos/butlerx/cp-users-service/subscription","commits_url":"https://api.github.com/repos/butlerx/cp-users-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/butlerx/cp-users-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/butlerx/cp-users-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/butlerx/cp-users-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/butlerx/cp-users-service/contents/{+path}","compare_url":"https://api.github.com/repos/butlerx/cp-users-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/butlerx/cp-users-service/merges","archive_url":"https://api.github.com/repos/butlerx/cp-users-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/butlerx/cp-users-service/downloads","issues_url":"https://api.github.com/repos/butlerx/cp-users-service/issues{/number}","pulls_url":"https://api.github.com/repos/butlerx/cp-users-service/pulls{/number}","milestones_url":"https://api.github.com/repos/butlerx/cp-users-service/milestones{/number}","notifications_url":"https://api.github.com/repos/butlerx/cp-users-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/butlerx/cp-users-service/labels{/name}","releases_url":"https://api.github.com/repos/butlerx/cp-users-service/releases{/id}","deployments_url":"https://api.github.com/repos/butlerx/cp-users-service/deployments","created_at":"2016-04-02T17:05:08Z","updated_at":"2016-04-02T17:05:09Z","pushed_at":"2016-07-01T14:26:16Z","git_url":"git://github.com/butlerx/cp-users-service.git","ssh_url":"git@github.com:butlerx/cp-users-service.git","clone_url":"https://github.com/butlerx/cp-users-service.git","svn_url":"https://github.com/butlerx/cp-users-service","homepage":"https://github.com/CoderDojo/community-platform","size":571,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"CoderDojo:master","ref":"master","sha":"88609f302849463045256b6991d329d327a5ac08","user":{"login":"CoderDojo","id":1159537,"avatar_url":"https://avatars.githubusercontent.com/u/1159537?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderDojo","html_url":"https://github.com/CoderDojo","followers_url":"https://api.github.com/users/CoderDojo/followers","following_url":"https://api.github.com/users/CoderDojo/following{/other_user}","gists_url":"https://api.github.com/users/CoderDojo/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderDojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderDojo/subscriptions","organizations_url":"https://api.github.com/users/CoderDojo/orgs","repos_url":"https://api.github.com/users/CoderDojo/repos","events_url":"https://api.github.com/users/CoderDojo/events{/privacy}","received_events_url":"https://api.github.com/users/CoderDojo/received_events","type":"Organization","site_admin":false},"repo":{"id":34259117,"name":"cp-users-service","full_name":"CoderDojo/cp-users-service","owner":{"login":"CoderDojo","id":1159537,"avatar_url":"https://avatars.githubusercontent.com/u/1159537?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderDojo","html_url":"https://github.com/CoderDojo","followers_url":"https://api.github.com/users/CoderDojo/followers","following_url":"https://api.github.com/users/CoderDojo/following{/other_user}","gists_url":"https://api.github.com/users/CoderDojo/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderDojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderDojo/subscriptions","organizations_url":"https://api.github.com/users/CoderDojo/orgs","repos_url":"https://api.github.com/users/CoderDojo/repos","events_url":"https://api.github.com/users/CoderDojo/events{/privacy}","received_events_url":"https://api.github.com/users/CoderDojo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CoderDojo/cp-users-service","description":"This is the users service, a backend repository of the CoderDojo Zen Community Platform project.","fork":false,"url":"https://api.github.com/repos/CoderDojo/cp-users-service","forks_url":"https://api.github.com/repos/CoderDojo/cp-users-service/forks","keys_url":"https://api.github.com/repos/CoderDojo/cp-users-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CoderDojo/cp-users-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CoderDojo/cp-users-service/teams","hooks_url":"https://api.github.com/repos/CoderDojo/cp-users-service/hooks","issue_events_url":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/events{/number}","events_url":"https://api.github.com/repos/CoderDojo/cp-users-service/events","assignees_url":"https://api.github.com/repos/CoderDojo/cp-users-service/assignees{/user}","branches_url":"https://api.github.com/repos/CoderDojo/cp-users-service/branches{/branch}","tags_url":"https://api.github.com/repos/CoderDojo/cp-users-service/tags","blobs_url":"https://api.github.com/repos/CoderDojo/cp-users-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CoderDojo/cp-users-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CoderDojo/cp-users-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/CoderDojo/cp-users-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CoderDojo/cp-users-service/statuses/{sha}","languages_url":"https://api.github.com/repos/CoderDojo/cp-users-service/languages","stargazers_url":"https://api.github.com/repos/CoderDojo/cp-users-service/stargazers","contributors_url":"https://api.github.com/repos/CoderDojo/cp-users-service/contributors","subscribers_url":"https://api.github.com/repos/CoderDojo/cp-users-service/subscribers","subscription_url":"https://api.github.com/repos/CoderDojo/cp-users-service/subscription","commits_url":"https://api.github.com/repos/CoderDojo/cp-users-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/CoderDojo/cp-users-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/CoderDojo/cp-users-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/CoderDojo/cp-users-service/contents/{+path}","compare_url":"https://api.github.com/repos/CoderDojo/cp-users-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CoderDojo/cp-users-service/merges","archive_url":"https://api.github.com/repos/CoderDojo/cp-users-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CoderDojo/cp-users-service/downloads","issues_url":"https://api.github.com/repos/CoderDojo/cp-users-service/issues{/number}","pulls_url":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls{/number}","milestones_url":"https://api.github.com/repos/CoderDojo/cp-users-service/milestones{/number}","notifications_url":"https://api.github.com/repos/CoderDojo/cp-users-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CoderDojo/cp-users-service/labels{/name}","releases_url":"https://api.github.com/repos/CoderDojo/cp-users-service/releases{/id}","deployments_url":"https://api.github.com/repos/CoderDojo/cp-users-service/deployments","created_at":"2015-04-20T12:30:00Z","updated_at":"2016-01-29T15:41:23Z","pushed_at":"2016-07-01T14:28:01Z","git_url":"git://github.com/CoderDojo/cp-users-service.git","ssh_url":"git@github.com:CoderDojo/cp-users-service.git","clone_url":"https://github.com/CoderDojo/cp-users-service.git","svn_url":"https://github.com/CoderDojo/cp-users-service","homepage":"https://github.com/CoderDojo/community-platform","size":615,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":5,"forks":24,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202"},"html":{"href":"https://github.com/CoderDojo/cp-users-service/pull/202"},"issue":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/202"},"comments":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/CoderDojo/cp-users-service/statuses/19e906e5d81ef1fe2ba7f83dbaeb771809f44954"}}}}
{"actor":{"display_login":"Wardormeur"}}