{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/2416","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/2416/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/2416/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/2416/events","html_url":"https://github.com/square/okhttp/issues/2416","id":142018506,"number":2416,"title":"Transparent GZIP decompression only returns single line of document from response.","user":{"login":"drewdiddy611","id":3035686,"avatar_url":"https://avatars.githubusercontent.com/u/3035686?v=3","gravatar_id":"","url":"https://api.github.com/users/drewdiddy611","html_url":"https://github.com/drewdiddy611","followers_url":"https://api.github.com/users/drewdiddy611/followers","following_url":"https://api.github.com/users/drewdiddy611/following{/other_user}","gists_url":"https://api.github.com/users/drewdiddy611/gists{/gist_id}","starred_url":"https://api.github.com/users/drewdiddy611/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewdiddy611/subscriptions","organizations_url":"https://api.github.com/users/drewdiddy611/orgs","repos_url":"https://api.github.com/users/drewdiddy611/repos","events_url":"https://api.github.com/users/drewdiddy611/events{/privacy}","received_events_url":"https://api.github.com/users/drewdiddy611/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-19T02:25:09Z","updated_at":"2016-03-19T04:56:50Z","closed_at":null,"body":"I'm having an issue with transparent GZIP decompression.  \r\n\r\nI'm not sure if this is the webserver returning a weird response, I'm also not sure what kind of information you need from me in this case.\r\n\r\nBasically, If I let OkHttp handle decompression transparently, it only returns a single line of the document from the response.  However, when I handle decompression myself using a GZIPInputStream, and read from it using a BufferedReader from `body().byteStream()`, I get the entire document. This way also gives me connection leaked warnings in my Logcat output, even though I'm calling `body().close()` after every request. (Even if I don't use the response body). \r\n\r\nPlease let me know if you need any more information, I would be happy to provide.\r\n\r\nP.S. I'm working on adding code and a test case to this post instead of using links. Just wanted to get it up to get initial responses on whether I was just crazy or not. :-)\r\n\r\n**EDIT**\r\n\r\nAfter building a simple test case, using Eclipse/Java environment (instead of Android libraries). This issue is not present. In both cases, the entire document is fetched correctly.  This issue only appears in the android app and for the specific server I am sending the request to, Response headers will be below...\r\n\r\nDependencies under gradle file.\r\n\r\ndependencies {\r\n    ...\r\n    compile 'com.android.support:appcompat-v7:23.2.1'\r\n    compile 'com.android.support:design:23.2.1'\r\n    compile 'com.squareup.okhttp3:okhttp:3.2.0'\r\n    compile 'com.android.support:support-v4:23.2.1'\r\n}\r\n\r\nResponse headers from the site:\r\n\r\nCache-Control: private\r\nContent-Type: text/html; charset=utf-8\r\nVary: Accept-Encoding\r\nServer: Microsoft-IIS/7.5\r\nSet-Cookie: ASP.NET_SessionId=<omitted>; path=/; HttpOnly\r\nX-AspNet-Version: 2.0.50727\r\nX-Powered-By: ASP.NET\r\nDate: Sat, 19 Mar 2016 03:17:25 GMT\r\nOkHttp-Sent-Millis: 1458358005672\r\nOkHttp-Received-Millis: 1458358005742\r\n\r\nAgain, this only happens in the android app, and only when sending the request to this specific website.  If I send the request to google.com or facebook.com, it succeeds. But for some reason, everything works fine when not using the android libraries.  \r\n"},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/198633304","html_url":"https://github.com/square/okhttp/issues/2416#issuecomment-198633304","issue_url":"https://api.github.com/repos/square/okhttp/issues/2416","id":198633304,"user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T04:56:50Z","updated_at":"2016-03-19T04:56:50Z","body":"Ie. what happens if you log the string’s length, rather than the string itself?"}}