I can't seem to be able to get DownloadManager in Java/Android properly decode gzip files (in this case from S3 bucket). Same link decodes properly when downloading from, say, Chrome, which seems to use DownloadManager as well. There doesn't seem to be anything in the docs that explain how to do this.
here's some sample code. The result is the file gets downloaded, but is still in gzipped format. Not the case when downloading with chrome. How do I do this properly?
downmanager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
Request request = new Request(Uri.parse("https://somurl.com/somefile.wad"));
request.addRequestHeader("Accept-Encoding", "gzip, deflate");
Uri localUri = Uri.parse("file://"+this.getExternalFilesDir(null).getPath()+"/test.wad");
request.setDestinationUri(localUri);
downmanager.enqueue(request);