Support compressed network transfers #240
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the curl loader would not send an accept-encoding header, so was relying on HTTP servers deciding to transmit an uncompressed response. If they sent a compressed response instead (as is permitted by the HTTP spec), it would be passed to the next loader still compressed.
This change tells curl to inform the server about all the compression algorithms it supports (typically constrained by the curl version and which libraries were available when it was built). It also tells curl to decompress the data it receives according to the server's content-encoding header before giving it to us.
As a result, most network requests will be smaller and faster (as servers can be confident that we can decompress their responses), and in rarer situations where servers refuse to give uncompressed responses, compatibility should be better.