{"action":"created","issue":{"url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/94","labels_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/94/comments","events_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/94/events","html_url":"https://github.com/NanoHttpd/nanohttpd/issues/94","id":26303813,"number":94,"title":"Don't use InputStream.available() as Content-Length","user":{"login":"steventebrinke","id":1277338,"avatar_url":"https://avatars.githubusercontent.com/u/1277338?v=3","gravatar_id":"","url":"https://api.github.com/users/steventebrinke","html_url":"https://github.com/steventebrinke","followers_url":"https://api.github.com/users/steventebrinke/followers","following_url":"https://api.github.com/users/steventebrinke/following{/other_user}","gists_url":"https://api.github.com/users/steventebrinke/gists{/gist_id}","starred_url":"https://api.github.com/users/steventebrinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steventebrinke/subscriptions","organizations_url":"https://api.github.com/users/steventebrinke/orgs","repos_url":"https://api.github.com/users/steventebrinke/repos","events_url":"https://api.github.com/users/steventebrinke/events{/privacy}","received_events_url":"https://api.github.com/users/steventebrinke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NanoHttpd/nanohttpd/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"ritchieGitHub","id":9456779,"avatar_url":"https://avatars.githubusercontent.com/u/9456779?v=3","gravatar_id":"","url":"https://api.github.com/users/ritchieGitHub","html_url":"https://github.com/ritchieGitHub","followers_url":"https://api.github.com/users/ritchieGitHub/followers","following_url":"https://api.github.com/users/ritchieGitHub/following{/other_user}","gists_url":"https://api.github.com/users/ritchieGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/ritchieGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritchieGitHub/subscriptions","organizations_url":"https://api.github.com/users/ritchieGitHub/orgs","repos_url":"https://api.github.com/users/ritchieGitHub/repos","events_url":"https://api.github.com/users/ritchieGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/ritchieGitHub/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2014-01-25T23:38:09Z","updated_at":"2015-05-12T05:51:47Z","closed_at":null,"body":"The documentation of InputStream.available() tells the following:\r\n> Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not.\r\n\r\nOn Android, the documentation is even more clear about this:\r\n> Secondly, the result is a conservative estimate and may be significantly smaller than the actual number of bytes available. In particular, an implementation that always returns 0 would be correct. In general, callers should only use this method if they'd be satisfied with treating the result as a boolean yes or no answer to the question \"is there definitely data ready?\".\r\n\r\nTherefore, using the result of this method as Content-Length, which is currently done, is definitely broken on Android and possibly on other platforms, since the method does not give the guarantee that Content-Length gives."},"comment":{"url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/comments/101140456","html_url":"https://github.com/NanoHttpd/nanohttpd/issues/94#issuecomment-101140456","issue_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/94","id":101140456,"user":{"login":"ritchieGitHub","id":9456779,"avatar_url":"https://avatars.githubusercontent.com/u/9456779?v=3","gravatar_id":"","url":"https://api.github.com/users/ritchieGitHub","html_url":"https://github.com/ritchieGitHub","followers_url":"https://api.github.com/users/ritchieGitHub/followers","following_url":"https://api.github.com/users/ritchieGitHub/following{/other_user}","gists_url":"https://api.github.com/users/ritchieGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/ritchieGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritchieGitHub/subscriptions","organizations_url":"https://api.github.com/users/ritchieGitHub/orgs","repos_url":"https://api.github.com/users/ritchieGitHub/repos","events_url":"https://api.github.com/users/ritchieGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/ritchieGitHub/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T05:51:47Z","updated_at":"2015-05-12T05:51:47Z","body":"Could you do this? I have not much time till the weekend, only some issue categorizing I do between the lines."}}