We were seeing this error when processing responses back from HTTP calls in
camel after an upgrade from 5.5.2 –> 5.6.3 due to OWASP findings.


It seems that starting in Apache HttpClient 5.6, the library introduced
transparent response decompression which automatically decodes GZIP/deflate
streams but no longer strips the Content-Encoding header. Because Apache
Camel's HttpProducer still checks this header and attempts a secondary
uncompression via GZIPHelper, the stream is double-decoded, causing the
ZipException

https://github.com/spring-projects/spring-ws/issues/1754

https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-24234?filter=allissues
Hope that helps
David

On Thu, Sep 3, 2026 at 12:35 PM Martin Lichtin via users <
[email protected]> wrote:

> Wanted to ask about this situation with Camel Http Component deciding to
> gunzip the response (due to header Content-Encoding: gzip) when in fact
> the HttpClient already did that.
> Symptom is:
>
> java.util.zip.ZipException: Not in GZIP format
>          at
>
> java.base/java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:176)
>          at
> java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79)
>          at
> java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)
>          at
> org.apache.camel.support.GZIPHelper.uncompressGzip(GZIPHelper.java:41)
>          at
>
> org.apache.camel.component.http.HttpProducer.extractResponseBody(HttpProducer.java:543)
>          at
>
> org.apache.camel.component.http.HttpProducer.populateResponse(HttpProducer.java:363)
>          at
>
> org.apache.camel.component.http.HttpProducer.lambda$process$1(HttpProducer.java:266)
>          at
>
> org.apache.camel.component.http.HttpProducer.executeMethod(HttpProducer.java:500)
>          at
> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:253)
>
> Setting Exchange.SKIP_GZIP_ENCODING=true solves the issue, but it does
> seem like a crude workaround.
>
> I've seen a discussion where Httpclient maintainers say that one should
> exclusively look at HttpEntity to deduce the content encoding, not the
> header.
>
> Camel 4.18.2, Httpclient 5.6.4
>
> Thanks - Martin
>
>

Reply via email to