{"action":"opened","issue":{"url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/153","labels_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/153/comments","events_url":"https://api.github.com/repos/NanoHttpd/nanohttpd/issues/153/events","html_url":"https://github.com/NanoHttpd/nanohttpd/issues/153","id":53748641,"number":153,"title":"Not all contents are read from input stream when processing POST","user":{"login":"martinrotter","id":1255302,"avatar_url":"https://avatars.githubusercontent.com/u/1255302?v=3","gravatar_id":"","url":"https://api.github.com/users/martinrotter","html_url":"https://github.com/martinrotter","followers_url":"https://api.github.com/users/martinrotter/followers","following_url":"https://api.github.com/users/martinrotter/following{/other_user}","gists_url":"https://api.github.com/users/martinrotter/gists{/gist_id}","starred_url":"https://api.github.com/users/martinrotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinrotter/subscriptions","organizations_url":"https://api.github.com/users/martinrotter/orgs","repos_url":"https://api.github.com/users/martinrotter/repos","events_url":"https://api.github.com/users/martinrotter/events{/privacy}","received_events_url":"https://api.github.com/users/martinrotter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-08T13:09:54Z","updated_at":"2015-01-08T13:09:54Z","closed_at":null,"body":"Problem is here: https://github.com/NanoHttpd/nanohttpd/blob/master/core/src/main/java/fi/iki/elonen/NanoHTTPD.java#L1014\r\n\r\nImagine my file is 600 bytes long AND 511st, 512nd bytes are \"\\r\\n\". Then your code reads first 512 bytes chunk (which ends with \"\\r\\n\") and then stops at that point because second condition in while cycle is not met, but there still remains 88 bytes in input stream!!\r\n\r\nWhy do you exactly use second condition in that while cycle?"}}