-
Notifications
You must be signed in to change notification settings - Fork 603
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
Fix Compression #1478
Fix Compression #1478
Conversation
- Decompress compressed responses, whether or not use_compression is set.
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@picandocodigo can you please review this? |
At TableCheck we are using this in production by the way (with Faraday) |
Thanks for this contribution @johnnyshields! I'll review and merge it as soon as possible 👍 |
jenkins test this please |
Thank you very much for this contribution @johnnyshields! |
- "compression" option should compress outbound requests. - Decompress compressed responses, whether or not use_compression is set. Properly set header on gzipped request body Perform compression inside HTTP adapters Explicitly require zlib library Content-Encoding is set in the HTTP adapters, so we don't need it in the apply_headers method Add specs for curb, faraday, and manticore Update curb_spec.rb
The Problem
The
compression
option is badly broken.This is from the documents:
In fact, much of this is not working as per spec.
Whether to compress requests.
--> NOT WORKING The option does not currently compress requests, it merely sets theAccept-Encoding
header which only affects responses.Responses are automatically inflated if they are compressed.
--> NOT WORKING. Responses are currently not inflated unless thecompression
option is explicitly set. This means that ifcompression
is not set, any compressed responses will be unreadable (i.e. cause an error.)The Fix
compression
option should compress outbound requests by setting theContent-Encoding
header.Content-Encoding
header is set.)compression
is set.