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

Auto decompress gzip-encoding response bodies #838

Merged
merged 6 commits into from
May 28, 2022
Merged

Auto decompress gzip-encoding response bodies #838

merged 6 commits into from
May 28, 2022

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented May 28, 2022

Implements #256. If the content-encoding of a response is "gzip"
and the keyword argument decompress === true, then we'll
use CodecZlib.jl to decompress the response and set as the response
body. Passing decompress=false will leave the resposne body as-is.
We also support HTTP.decode(::Request, "gzip") which will do
the decompression.

Implements #256. If the content-encoding of a response is "gzip"
and the keyword argument `decompress === true`, then we'll
use CodecZlib.jl to decompress the response and set as the response
body. Passing `decompress=false` will leave the resposne body as-is.
We also support `HTTP.decode(::Request, "gzip")` which will do
the decompression.
src/StreamRequest.jl Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 28, 2022

Codecov Report

Merging #838 (f524b24) into master (7a0fdf2) will increase coverage by 0.23%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #838      +/-   ##
==========================================
+ Coverage   80.56%   80.80%   +0.23%     
==========================================
  Files          36       36              
  Lines        2645     2636       -9     
==========================================
- Hits         2131     2130       -1     
+ Misses        514      506       -8     
Impacted Files Coverage Δ
src/HTTP.jl 83.05% <ø> (ø)
src/DebugRequest.jl 100.00% <100.00%> (+16.66%) ⬆️
src/Messages.jl 89.11% <100.00%> (+3.98%) ⬆️
src/Parsers.jl 97.27% <100.00%> (-0.23%) ⬇️
src/StreamRequest.jl 100.00% <100.00%> (ø)
src/Strings.jl 100.00% <100.00%> (ø)
src/RetryRequest.jl 65.21% <0.00%> (+4.34%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@quinnj quinnj merged commit 6714dcb into master May 28, 2022
@quinnj quinnj deleted the jq/decompress branch May 28, 2022 14:05
@fonsp
Copy link
Member

fonsp commented Jun 8, 2022

Awesome, thanks Jacob!!

This means that we could add "Accept-Encoding" => "gzip" to our default headers, if decompress=true.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding

@quinnj
Copy link
Member Author

quinnj commented Jun 10, 2022

Great idea! Mind making a PR @fonsp?

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

Successfully merging this pull request may close these issues.

4 participants