Skip to content
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

HC5 client can't send compressed POST requests #2245

Closed
fbus opened this issue Nov 27, 2023 · 1 comment
Closed

HC5 client can't send compressed POST requests #2245

fbus opened this issue Nov 27, 2023 · 1 comment

Comments

@fbus
Copy link
Contributor

fbus commented Nov 27, 2023

ApacheHttp5Client does not check if there is an 'Accept-Encoding' header when building the HttpRequest

https://github.com/OpenFeign/feign/blob/885f3e3400e564c8a4aa2642629452e9604c552e/hc5/src/main/java/feign/hc5/ApacheHttp5Client.java#L124C12-L124C12

when there is a gzip header, it should create a GzipCompressingEntity to wrap the StringEntity / ByteArrayEntity.

Because of this, the body is not compressed, while my request has an 'Accept-Encoding: gzip' header. And the server replies with a '500 Not in GZIP format' error.

@fbus
Copy link
Contributor Author

fbus commented Nov 27, 2023

as far as I can tell, the default Client is the only one handling properly this case : https://github.com/fbus/feign/blob/885f3e3400e564c8a4aa2642629452e9604c552e/core/src/main/java/feign/Client.java#L225-L226
OkHttp and HC4 are doint have the same bug as hc5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant