Ron, you have saved my project and... my mental health
I was struggling with that issue for a long time and finally I have it fixed! Please take this piece of pie as my thanks!
So here is what I did. I am building my
HttpClient with
HttpClients.custom(). I have tried to add the interceptor with
addInterceptorFirst but it didn't work. The content-encoding was processed somewhere before this interceptor. After some time of diving in the docs trying to learn the entire process, I have found that I can provide my own custom
HttpProcessor for the
HttpClient. As processing of content-encoding is done inside the default
HttpProcessor, I wrote my own that deals with this header before anything else. Result: success!
Here is the code I used, for future generations. I removed all unnecessary elements for simplicity.
Creation of the HttpClient:
Creation of the HttpProcessor:
Code of the HttpResponseInterceptor: