{"action":"created","issue":{"url":"https://api.github.com/repos/ethanresnick/json-api/issues/58","labels_url":"https://api.github.com/repos/ethanresnick/json-api/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/ethanresnick/json-api/issues/58/comments","events_url":"https://api.github.com/repos/ethanresnick/json-api/issues/58/events","html_url":"https://github.com/ethanresnick/json-api/pull/58","id":103494733,"number":58,"title":"Input validation and error avoidance","user":{"login":"carlbennettnz","id":1134869,"avatar_url":"https://avatars.githubusercontent.com/u/1134869?v=3","gravatar_id":"","url":"https://api.github.com/users/carlbennettnz","html_url":"https://github.com/carlbennettnz","followers_url":"https://api.github.com/users/carlbennettnz/followers","following_url":"https://api.github.com/users/carlbennettnz/following{/other_user}","gists_url":"https://api.github.com/users/carlbennettnz/gists{/gist_id}","starred_url":"https://api.github.com/users/carlbennettnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlbennettnz/subscriptions","organizations_url":"https://api.github.com/users/carlbennettnz/orgs","repos_url":"https://api.github.com/users/carlbennettnz/repos","events_url":"https://api.github.com/users/carlbennettnz/events{/privacy}","received_events_url":"https://api.github.com/users/carlbennettnz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-27T12:11:35Z","updated_at":"2015-08-27T23:20:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ethanresnick/json-api/pulls/58","html_url":"https://github.com/ethanresnick/json-api/pull/58","diff_url":"https://github.com/ethanresnick/json-api/pull/58.diff","patch_url":"https://github.com/ethanresnick/json-api/pull/58.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/ethanresnick/json-api/issues/comments/135581215","html_url":"https://github.com/ethanresnick/json-api/pull/58#issuecomment-135581215","issue_url":"https://api.github.com/repos/ethanresnick/json-api/issues/58","id":135581215,"user":{"login":"ethanresnick","id":471894,"avatar_url":"https://avatars.githubusercontent.com/u/471894?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanresnick","html_url":"https://github.com/ethanresnick","followers_url":"https://api.github.com/users/ethanresnick/followers","following_url":"https://api.github.com/users/ethanresnick/following{/other_user}","gists_url":"https://api.github.com/users/ethanresnick/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanresnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanresnick/subscriptions","organizations_url":"https://api.github.com/users/ethanresnick/orgs","repos_url":"https://api.github.com/users/ethanresnick/repos","events_url":"https://api.github.com/users/ethanresnick/events{/privacy}","received_events_url":"https://api.github.com/users/ethanresnick/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T23:20:22Z","updated_at":"2015-08-27T23:20:22Z","body":"Thanks for this! \r\n\r\nMoving the id-query logic to a separate helper function is quite nice, and may make patching #52 easier also. I'll review that carefully when I have a sec and will merge it in.\r\n\r\nAbout `hasBody`: I got that function from the [type-is](https://github.com/jshttp/type-is/blob/master/index.js#L92) library, which explicitly says that returning true for `Content Length: 0` is the [expected behavior](https://github.com/jshttp/type-is/blob/master/test/test.js#L160). Their argument for that behavior is a reference to RFC 7230 says [simply](https://tools.ietf.org/html/rfc7230#section-3.3):\r\n\r\n> The presence of a message body in a request is signaled by a Content-Length or Transfer-Encoding header field.\r\n\r\nAnd [later](https://tools.ietf.org/html/rfc7230#section-3.3.2) says:\r\n\r\n> A user agent SHOULD send a Content-Length in a request message when no Transfer-Encoding is sent and the request method defines a meaning for an enclosed payload body.  For example, a Content-Length header field is normally sent in a POST request even when the value is 0 (indicating an empty payload body)... Any Content-Length field value greater than or equal to zero is valid.\r\n\r\nPersonally, I can see an argument for both returning `true` and `false`, but the real question is: is returning `true` breaking anything? If not, I don't think we should bother changing it. I'm also pretty sure that this `Length: 0` case isn't causing any issues with `getRawBody`, which [also accounts for this case](https://github.com/stream-utils/raw-body/blob/master/test/index.js#L52)."}}