{"action":"created","issue":{"url":"https://api.github.com/repos/square/retrofit/issues/804","labels_url":"https://api.github.com/repos/square/retrofit/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/square/retrofit/issues/804/comments","events_url":"https://api.github.com/repos/square/retrofit/issues/804/events","html_url":"https://github.com/square/retrofit/issues/804","id":67579345,"number":804,"title":"0-byte gzip response causes java.io.EOFException","user":{"login":"igokoro","id":2870939,"avatar_url":"https://avatars.githubusercontent.com/u/2870939?v=3","gravatar_id":"","url":"https://api.github.com/users/igokoro","html_url":"https://github.com/igokoro","followers_url":"https://api.github.com/users/igokoro/followers","following_url":"https://api.github.com/users/igokoro/following{/other_user}","gists_url":"https://api.github.com/users/igokoro/gists{/gist_id}","starred_url":"https://api.github.com/users/igokoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igokoro/subscriptions","organizations_url":"https://api.github.com/users/igokoro/orgs","repos_url":"https://api.github.com/users/igokoro/repos","events_url":"https://api.github.com/users/igokoro/events{/privacy}","received_events_url":"https://api.github.com/users/igokoro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-10T11:58:43Z","updated_at":"2015-04-10T12:13:24Z","closed_at":null,"body":"I'm using Retrofit (1.9.0) with OhHttp/okio (2.3.0/1.3.0) to implement communication with OneDrive REST API. While almost everything works amazingly well, there is a problem with ```java.io.EOFException``` on [action.copy](http://onedrive.github.io/items/copy.htm). \r\n\r\nOneDrive server returns \r\n```\r\nHTTP 202 Accepted\r\nContent-Length: 0\r\nContent-Encoding: gzip\r\n```\r\nUnder the hood OkHttp uses ```GzipSource``` to work with  gzip stream. The problem is that GzipSource tries to consume 10-byte gzip header from 0-length stream, so the ```java.io.EOFException``` is thrown because of seemingly missing 10 bytes.\r\n\r\nHere is the original stack trace from my application:\r\n```\r\nretrofit.RetrofitError\r\n            at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:395)\r\n            at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)\r\n            at java.lang.reflect.Proxy.invoke(Proxy.java:397)\r\n            at $Proxy13.copy(Unknown Source)\r\n            at com.ncryptedcloud.cloudprovider.onedrive.OneDriveCloudProvider.copy(OneDriveCloudProvider.java:731)\r\n            at com.ncryptedcloud.operation.cloudprovider.CopyFileOperation.execute(CopyFileOperation.java:72)\r\n            at com.foxykeep.datadroid.service.RequestService.onHandleIntent(RequestService.java:145)\r\n            at com.foxykeep.datadroid.service.MultiThreadedIntentService$IntentRunnable.run(MultiThreadedIntentService.java:170)\r\n            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)\r\n            at java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n            at java.lang.Thread.run(Thread.java:818)\r\n     Caused by: java.io.EOFException\r\n            at okio.RealBufferedSource.require(RealBufferedSource.java:64)\r\n            at okio.GzipSource.consumeHeader(GzipSource.java:114)\r\n            at okio.GzipSource.read(GzipSource.java:73)\r\n            at okio.RealBufferedSource$1.read(RealBufferedSource.java:338)\r\n            at java.io.InputStream.read(InputStream.java:162)\r\n            at retrofit.Utils.streamToBytes(Utils.java:43)\r\n            at retrofit.Utils.readBodyToBytesIfNecessary(Utils.java:81)\r\n            at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:348)\r\n            at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)\r\n            at java.lang.reflect.Proxy.invoke(Proxy.java:397)\r\n            at $Proxy13.copy(Unknown Source)\r\n            at com.ncryptedcloud.cloudprovider.onedrive.OneDriveCloudProvider.copy(OneDriveCloudProvider.java:731)\r\n            at com.ncryptedcloud.operation.cloudprovider.CopyFileOperation.execute(CopyFileOperation.java:72)\r\n            at com.foxykeep.datadroid.service.RequestService.onHandleIntent(RequestService.java:145)\r\n            at com.foxykeep.datadroid.service.MultiThreadedIntentService$IntentRunnable.run(MultiThreadedIntentService.java:170)\r\n            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)\r\n            at java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n            at java.lang.Thread.run(Thread.java:818)\r\n```\r\n\r\nWhile the problem is almost 100% likely on the OkHttp side, I wonder if it's possible to handle it on the Retrofit side?"},"comment":{"url":"https://api.github.com/repos/square/retrofit/issues/comments/91534779","html_url":"https://github.com/square/retrofit/issues/804#issuecomment-91534779","issue_url":"https://api.github.com/repos/square/retrofit/issues/804","id":91534779,"user":{"login":"sohayb","id":2195533,"avatar_url":"https://avatars.githubusercontent.com/u/2195533?v=3","gravatar_id":"","url":"https://api.github.com/users/sohayb","html_url":"https://github.com/sohayb","followers_url":"https://api.github.com/users/sohayb/followers","following_url":"https://api.github.com/users/sohayb/following{/other_user}","gists_url":"https://api.github.com/users/sohayb/gists{/gist_id}","starred_url":"https://api.github.com/users/sohayb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sohayb/subscriptions","organizations_url":"https://api.github.com/users/sohayb/orgs","repos_url":"https://api.github.com/users/sohayb/repos","events_url":"https://api.github.com/users/sohayb/events{/privacy}","received_events_url":"https://api.github.com/users/sohayb/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T12:13:24Z","updated_at":"2015-04-10T12:13:24Z","body":"Hey @igokoro , check #755 "}}