Commit fd28177
authored
fix: support for compressed content in download2stream method. (#353)
Fixes #352 .
By switching from `iter_raw` to `iter_bytes`, **httpx will automatically
handle the decompression** if the `Content-Encoding: gzip` header is
present. If the header is absent or specifies no compression (like
identity), `iter_bytes` will yield the original bytes, just like
`iter_raw` would have.
Signed-off-by: bigcat88 <bigcat88@icloud.com>1 parent 57c6d34 commit fd28177
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| |||
0 commit comments