{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/psd401/eddata-api/pulls/2","id":43570829,"html_url":"https://github.com/psd401/eddata-api/pull/2","diff_url":"https://github.com/psd401/eddata-api/pull/2.diff","patch_url":"https://github.com/psd401/eddata-api/pull/2.patch","issue_url":"https://api.github.com/repos/psd401/eddata-api/issues/2","number":2,"state":"open","locked":false,"title":"Fix can't send headers after they are sent","user":{"login":"darrn","id":7143383,"avatar_url":"https://avatars.githubusercontent.com/u/7143383?v=3","gravatar_id":"","url":"https://api.github.com/users/darrn","html_url":"https://github.com/darrn","followers_url":"https://api.github.com/users/darrn/followers","following_url":"https://api.github.com/users/darrn/following{/other_user}","gists_url":"https://api.github.com/users/darrn/gists{/gist_id}","starred_url":"https://api.github.com/users/darrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrn/subscriptions","organizations_url":"https://api.github.com/users/darrn/orgs","repos_url":"https://api.github.com/users/darrn/repos","events_url":"https://api.github.com/users/darrn/events{/privacy}","received_events_url":"https://api.github.com/users/darrn/received_events","type":"User","site_admin":false},"body":"If the function Computer.findOne encountered an error this would cause res.send to run. However, it did not stop res.send from running a second time (which caused the stack trace at the bottom).\r\n\r\n\r\nThu, 27 Aug 2015 20:44:47 GMT express deprecated res.send(status, body): Use res.status(status).send(body) instead at src/app/routes/computers.js:166:13\r\n\r\nError: Can't set headers after they are sent.\r\n    at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)\r\n    at ServerResponse.header (/src/node_modules/express/lib/response.js:718:10)\r\n    at ServerResponse.send (/src/node_modules/express/lib/response.js:163:12)\r\n    at Promise.<anonymous> (/src/app/routes/computers.js:166:13)\r\n    at Promise.<anonymous> (/src/node_modules/mongoose/node_modules/mpromise/lib/promise.js:172:8)\r\n    at Promise.emit (events.js:95:17)\r\n    at Promise.emit (/src/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)\r\n    at Promise.reject (/src/node_modules/mongoose/node_modules/mpromise/lib/promise.js:111:15)\r\n    at Promise.error (/src/node_modules/mongoose/lib/promise.js:95:15)\r\n    at process._tickCallback (node.js:442:13)\r\n","created_at":"2015-08-27T21:46:01Z","updated_at":"2015-08-27T21:46:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/psd401/eddata-api/pulls/2/commits","review_comments_url":"https://api.github.com/repos/psd401/eddata-api/pulls/2/comments","review_comment_url":"https://api.github.com/repos/psd401/eddata-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/psd401/eddata-api/issues/2/comments","statuses_url":"https://api.github.com/repos/psd401/eddata-api/statuses/2d72c9e1d612559025c510a6c669828f91807014","head":{"label":"darrn:master","ref":"master","sha":"2d72c9e1d612559025c510a6c669828f91807014","user":{"login":"darrn","id":7143383,"avatar_url":"https://avatars.githubusercontent.com/u/7143383?v=3","gravatar_id":"","url":"https://api.github.com/users/darrn","html_url":"https://github.com/darrn","followers_url":"https://api.github.com/users/darrn/followers","following_url":"https://api.github.com/users/darrn/following{/other_user}","gists_url":"https://api.github.com/users/darrn/gists{/gist_id}","starred_url":"https://api.github.com/users/darrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrn/subscriptions","organizations_url":"https://api.github.com/users/darrn/orgs","repos_url":"https://api.github.com/users/darrn/repos","events_url":"https://api.github.com/users/darrn/events{/privacy}","received_events_url":"https://api.github.com/users/darrn/received_events","type":"User","site_admin":false},"repo":{"id":41512645,"name":"eddata-api","full_name":"darrn/eddata-api","owner":{"login":"darrn","id":7143383,"avatar_url":"https://avatars.githubusercontent.com/u/7143383?v=3","gravatar_id":"","url":"https://api.github.com/users/darrn","html_url":"https://github.com/darrn","followers_url":"https://api.github.com/users/darrn/followers","following_url":"https://api.github.com/users/darrn/following{/other_user}","gists_url":"https://api.github.com/users/darrn/gists{/gist_id}","starred_url":"https://api.github.com/users/darrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrn/subscriptions","organizations_url":"https://api.github.com/users/darrn/orgs","repos_url":"https://api.github.com/users/darrn/repos","events_url":"https://api.github.com/users/darrn/events{/privacy}","received_events_url":"https://api.github.com/users/darrn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darrn/eddata-api","description":"","fork":true,"url":"https://api.github.com/repos/darrn/eddata-api","forks_url":"https://api.github.com/repos/darrn/eddata-api/forks","keys_url":"https://api.github.com/repos/darrn/eddata-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darrn/eddata-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darrn/eddata-api/teams","hooks_url":"https://api.github.com/repos/darrn/eddata-api/hooks","issue_events_url":"https://api.github.com/repos/darrn/eddata-api/issues/events{/number}","events_url":"https://api.github.com/repos/darrn/eddata-api/events","assignees_url":"https://api.github.com/repos/darrn/eddata-api/assignees{/user}","branches_url":"https://api.github.com/repos/darrn/eddata-api/branches{/branch}","tags_url":"https://api.github.com/repos/darrn/eddata-api/tags","blobs_url":"https://api.github.com/repos/darrn/eddata-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darrn/eddata-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darrn/eddata-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/darrn/eddata-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darrn/eddata-api/statuses/{sha}","languages_url":"https://api.github.com/repos/darrn/eddata-api/languages","stargazers_url":"https://api.github.com/repos/darrn/eddata-api/stargazers","contributors_url":"https://api.github.com/repos/darrn/eddata-api/contributors","subscribers_url":"https://api.github.com/repos/darrn/eddata-api/subscribers","subscription_url":"https://api.github.com/repos/darrn/eddata-api/subscription","commits_url":"https://api.github.com/repos/darrn/eddata-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/darrn/eddata-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/darrn/eddata-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/darrn/eddata-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/darrn/eddata-api/contents/{+path}","compare_url":"https://api.github.com/repos/darrn/eddata-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darrn/eddata-api/merges","archive_url":"https://api.github.com/repos/darrn/eddata-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darrn/eddata-api/downloads","issues_url":"https://api.github.com/repos/darrn/eddata-api/issues{/number}","pulls_url":"https://api.github.com/repos/darrn/eddata-api/pulls{/number}","milestones_url":"https://api.github.com/repos/darrn/eddata-api/milestones{/number}","notifications_url":"https://api.github.com/repos/darrn/eddata-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darrn/eddata-api/labels{/name}","releases_url":"https://api.github.com/repos/darrn/eddata-api/releases{/id}","created_at":"2015-08-27T21:38:02Z","updated_at":"2015-08-27T21:38:03Z","pushed_at":"2015-08-27T21:39:53Z","git_url":"git://github.com/darrn/eddata-api.git","ssh_url":"git@github.com:darrn/eddata-api.git","clone_url":"https://github.com/darrn/eddata-api.git","svn_url":"https://github.com/darrn/eddata-api","homepage":null,"size":1100,"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":"psd401:master","ref":"master","sha":"dd285dc262ecfed04b911e8be7fe2cf7268307e7","user":{"login":"psd401","id":1902994,"avatar_url":"https://avatars.githubusercontent.com/u/1902994?v=3","gravatar_id":"","url":"https://api.github.com/users/psd401","html_url":"https://github.com/psd401","followers_url":"https://api.github.com/users/psd401/followers","following_url":"https://api.github.com/users/psd401/following{/other_user}","gists_url":"https://api.github.com/users/psd401/gists{/gist_id}","starred_url":"https://api.github.com/users/psd401/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psd401/subscriptions","organizations_url":"https://api.github.com/users/psd401/orgs","repos_url":"https://api.github.com/users/psd401/repos","events_url":"https://api.github.com/users/psd401/events{/privacy}","received_events_url":"https://api.github.com/users/psd401/received_events","type":"Organization","site_admin":false},"repo":{"id":28671967,"name":"eddata-api","full_name":"psd401/eddata-api","owner":{"login":"psd401","id":1902994,"avatar_url":"https://avatars.githubusercontent.com/u/1902994?v=3","gravatar_id":"","url":"https://api.github.com/users/psd401","html_url":"https://github.com/psd401","followers_url":"https://api.github.com/users/psd401/followers","following_url":"https://api.github.com/users/psd401/following{/other_user}","gists_url":"https://api.github.com/users/psd401/gists{/gist_id}","starred_url":"https://api.github.com/users/psd401/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psd401/subscriptions","organizations_url":"https://api.github.com/users/psd401/orgs","repos_url":"https://api.github.com/users/psd401/repos","events_url":"https://api.github.com/users/psd401/events{/privacy}","received_events_url":"https://api.github.com/users/psd401/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psd401/eddata-api","description":"","fork":false,"url":"https://api.github.com/repos/psd401/eddata-api","forks_url":"https://api.github.com/repos/psd401/eddata-api/forks","keys_url":"https://api.github.com/repos/psd401/eddata-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psd401/eddata-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psd401/eddata-api/teams","hooks_url":"https://api.github.com/repos/psd401/eddata-api/hooks","issue_events_url":"https://api.github.com/repos/psd401/eddata-api/issues/events{/number}","events_url":"https://api.github.com/repos/psd401/eddata-api/events","assignees_url":"https://api.github.com/repos/psd401/eddata-api/assignees{/user}","branches_url":"https://api.github.com/repos/psd401/eddata-api/branches{/branch}","tags_url":"https://api.github.com/repos/psd401/eddata-api/tags","blobs_url":"https://api.github.com/repos/psd401/eddata-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psd401/eddata-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psd401/eddata-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/psd401/eddata-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psd401/eddata-api/statuses/{sha}","languages_url":"https://api.github.com/repos/psd401/eddata-api/languages","stargazers_url":"https://api.github.com/repos/psd401/eddata-api/stargazers","contributors_url":"https://api.github.com/repos/psd401/eddata-api/contributors","subscribers_url":"https://api.github.com/repos/psd401/eddata-api/subscribers","subscription_url":"https://api.github.com/repos/psd401/eddata-api/subscription","commits_url":"https://api.github.com/repos/psd401/eddata-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/psd401/eddata-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/psd401/eddata-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/psd401/eddata-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/psd401/eddata-api/contents/{+path}","compare_url":"https://api.github.com/repos/psd401/eddata-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psd401/eddata-api/merges","archive_url":"https://api.github.com/repos/psd401/eddata-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psd401/eddata-api/downloads","issues_url":"https://api.github.com/repos/psd401/eddata-api/issues{/number}","pulls_url":"https://api.github.com/repos/psd401/eddata-api/pulls{/number}","milestones_url":"https://api.github.com/repos/psd401/eddata-api/milestones{/number}","notifications_url":"https://api.github.com/repos/psd401/eddata-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psd401/eddata-api/labels{/name}","releases_url":"https://api.github.com/repos/psd401/eddata-api/releases{/id}","created_at":"2014-12-31T18:09:13Z","updated_at":"2015-04-21T20:42:59Z","pushed_at":"2015-08-27T21:15:38Z","git_url":"git://github.com/psd401/eddata-api.git","ssh_url":"git@github.com:psd401/eddata-api.git","clone_url":"https://github.com/psd401/eddata-api.git","svn_url":"https://github.com/psd401/eddata-api","homepage":null,"size":1100,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/psd401/eddata-api/pulls/2"},"html":{"href":"https://github.com/psd401/eddata-api/pull/2"},"issue":{"href":"https://api.github.com/repos/psd401/eddata-api/issues/2"},"comments":{"href":"https://api.github.com/repos/psd401/eddata-api/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/psd401/eddata-api/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/psd401/eddata-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/psd401/eddata-api/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/psd401/eddata-api/statuses/2d72c9e1d612559025c510a6c669828f91807014"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":28,"deletions":23,"changed_files":1}}