{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/express/issues/3137","repository_url":"https://api.github.com/repos/expressjs/express","labels_url":"https://api.github.com/repos/expressjs/express/issues/3137/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/express/issues/3137/comments","events_url":"https://api.github.com/repos/expressjs/express/issues/3137/events","html_url":"https://github.com/expressjs/express/pull/3137","id":191362005,"number":3137,"title":"Gracefully handle invalid status codes","user":{"login":"nickclaw","id":2576091,"avatar_url":"https://avatars.githubusercontent.com/u/2576091?v=3","gravatar_id":"","url":"https://api.github.com/users/nickclaw","html_url":"https://github.com/nickclaw","followers_url":"https://api.github.com/users/nickclaw/followers","following_url":"https://api.github.com/users/nickclaw/following{/other_user}","gists_url":"https://api.github.com/users/nickclaw/gists{/gist_id}","starred_url":"https://api.github.com/users/nickclaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickclaw/subscriptions","organizations_url":"https://api.github.com/users/nickclaw/orgs","repos_url":"https://api.github.com/users/nickclaw/repos","events_url":"https://api.github.com/users/nickclaw/events{/privacy}","received_events_url":"https://api.github.com/users/nickclaw/received_events","type":"User","site_admin":false},"labels":[{"id":98481977,"url":"https://api.github.com/repos/expressjs/express/labels/5.x","name":"5.x","color":"ededed","default":false},{"id":133578713,"url":"https://api.github.com/repos/expressjs/express/labels/pr","name":"pr","color":"006b75","default":false}],"state":"open","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"assignees":[{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-11-23T19:32:56Z","updated_at":"2016-11-23T20:20:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/expressjs/express/pulls/3137","html_url":"https://github.com/expressjs/express/pull/3137","diff_url":"https://github.com/expressjs/express/pull/3137.diff","patch_url":"https://github.com/expressjs/express/pull/3137.patch"},"body":"Currently if an invalid status code is sent in the response, node throws an exception on `writeHead` that afaik can't be handled in express. Instead it just leads to a hanging request. I realize that it's best practice for people to only send valid status codes, but I have seen:\r\n\r\n```if (err) res.sendStatus(err.code || 500)```\r\n\r\nfar too many times.\r\n\r\nThis change is similar to https://github.com/expressjs/express/pull/2797, which I think is ultimately a better solution. But this fix should be non breaking."},"comment":{"url":"https://api.github.com/repos/expressjs/express/issues/comments/262621040","html_url":"https://github.com/expressjs/express/pull/3137#issuecomment-262621040","issue_url":"https://api.github.com/repos/expressjs/express/issues/3137","id":262621040,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T20:20:57Z","updated_at":"2016-11-23T20:20:57Z","body":"I mean, #2797 seemed fine enough to merge, and I think there was a bunch of conversation before that throwing an error would be less surprising than silently changing the error, especially to figure out where in the code you're giving the method the wrong input."}}
{"actor":{"display_login":"dougwilson"}}