-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feign Content-Encoding gzip, deflate not supported #489
Comments
For testing purpose you can use this classes:
|
Interesting, I can not reproduce this at master only in version 1.0.3-RELEASE |
I think that I have figure out why it doesn't work, when used with version 1.0.3 the response body is wrapped in something like URLConnection internalls (based on what I have found after debuging), while with latest 1.1.0 snapshot when the ApacheHttpClient is enabled it's in fact org.apache.http.client.entity.DecompressingEntity populated by feign ApacheClient. So my believe is that when fallowing code snipet would be added to version 1.0.3:
This should work as a charm. |
I was missing one extra piece I had to also add the Ribbon HttpClient configuration. After that I was able to make that work in version 1.0.3. It works out of the box in 1.1.0 Leaving the gist: https://gist.github.com/jmnarloch/2ea0efbc292fd240096f |
Enabling Accept-Encoding: gzip, deflate through custom Feign RequestInterceptor on the outgoing requests ends with exception when the response is compressed (or in other word the payload is content encoded):
Tested with Undertow and Jetty GzipFilter. Spring Cloud version is 1.0.3.RELEASE
This is interesting behaviour since Feign internally can handle content encoding: https://github.com/Netflix/feign/blob/91e4d8209a0023b33e34c374c78a7c388870053e/core/src/main/java/feign/Client.java#L109
The text was updated successfully, but these errors were encountered: