HTTPResponse Disable GZip Decompression?

102 views
Skip to first unread message

mike%eng...@gtempaccount.com

unread,
Oct 13, 2014, 7:33:34 PM10/13/14
to google-http...@googlegroups.com
Hello, I am using the Http client 1.19 (from maven). I have a use case where I want to download GZIP files, and keep them compressed. However I see that HTTPResponse.getContent() contains the following code:

          // gzip encoding (wrap content with GZipInputStream)

          String contentEncoding = this.contentEncoding;

          if (contentEncoding != null && contentEncoding.contains("gzip")) {

            lowLevelResponseContent = new GZIPInputStream(lowLevelResponseContent);

          }


I'm considering creating a fork and implementing a way to either set a flag to allow this to be disabled, or perhaps exposing the lowLevelResponseContent through a get method or something.


However, before I do that, I wanted to check if maybe there's another way to do this that I haven't considered (some other class that I should be using etc.)?


If not, I would like some feedback from the committers before I proceed as to the preferred method of implementing this?


Thanks in advance.


-Mike


Daniel Wang

unread,
Oct 29, 2014, 5:36:48 PM10/29/14
to google-http...@googlegroups.com
Unfortunately there isn't a way to disable the decoding of GZipped content yet.

mi...@engisys.com

unread,
Jan 22, 2015, 2:07:32 PM1/22/15
to google-http...@googlegroups.com
I actually have implemented a patch for this and would like to contribute it. Is this link still valid for the process of contributing patches? https://code.google.com/p/google-http-java-client/wiki/BecomingAContributor (For example, I see it looks like you are transitioning over to github).

Thanks!

Daniel Wang

unread,
Jan 22, 2015, 5:01:13 PM1/22/15
to google-http...@googlegroups.com
We are working on updated instructions of contributing, but majority of the process documented there is still valid, e.g., signing a CLA, code reviewing process and etc. You have to fork and work with the new github repository though. 
Reply all
Reply to author
Forward
0 new messages