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