-
Notifications
You must be signed in to change notification settings - Fork 985
Elastic cloud Client prevents decompression of gzip compressed responses #1241
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
Comments
@laurenzonneveld I noticed that you are using Elasticsearch server version 7.15.2 but your PHP client is using In version 8 we rewrote the client from stratch and we used elastic-transport-php for the HTTP transport layer. This project uses can use any PSR-18 libraries for sending the HTTP request (Guzzle by default). Let me know if using Thanks! |
@ezimuel Thank you for the fast response. We have no problem using the 7.15.2 version of Elastic PHP. However, we would like to upgrade Elastic and client version 8.x since we want to make use of asynchronous requests. For now we have patched the We'd love to hear your findings regarding the 8.x client with Symfony HTTPClient. |
@laurenzonneveld I just completed the PR #1243 to fix this issue and to add the support for Symfony HTTP Client: HttplugClient and Psr18Client. Can you test it and let me know? Thanks! |
@ezimuel Thanks for the update, I'll be on vacation for the next 2 weeks. We'll test as soon as I get back. |
Just tested, works as expected. Thank you. |
Summary of problem or feature request
ClientBuilder::build()
adds anAccept-Encoding:gzip
header whenelasticCloudId
is provided but does not handle decompression of gzip compressed responses.We're using
Symfony\Component\HttpClient\HttplugClient
asasyncHttpClient
which adds gzip by default but does not handle decoding when theAccept-Encoding
header is explicitly set.As per Symfony HTTPClient maintainer:
symfony/symfony#34238 (comment)
Thus the Elastic Client should either handle decompressen (and check whether the required
zlib
PHP extension is loaded) or the Elastic Client should leave responsibility for decompression to thePsr\Http\Client\ClientInterface
implementation and not set the header at all, we prefer the latter.Code snippet of problem
And in Symfony HTTPClient:
System details
The text was updated successfully, but these errors were encountered: