Index: httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.178 diff -u -r1.178 HttpMethodBase.java --- httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java 3 Sep 2003 02:17:49 -0000 1.178 +++ httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java 5 Sep 2003 00:09:20 -0000 @@ -1763,6 +1763,13 @@ // close the underlying stream as soon as it is consumed, and notify // the watcher that the stream has been consumed. if (result != null) { + Header contentEncodingHeader = responseHeaders.getFirstHeader("Content-Encoding"); + if (contentEncodingHeader != null) { + String contentEncoding = contentEncodingHeader.getValue(); + if ("x-gzip".equalsIgnoreCase(contentEncoding) || "gzip".equalsIgnoreCase(contentEncoding)) { + result = new java.util.zip.GZIPInputStream(result); + } + } result = new AutoCloseInputStream( result,