Add support for gzip and brotli

Automatically sends the Accept-Encoding header on requests.

Not runtime-configurable, only with Cargo features.
This commit is contained in:
Malloc Voidstar
2021-09-26 05:11:07 -07:00
committed by Martin Algesten
parent 0f0dec5f32
commit 873e6066f3
3 changed files with 78 additions and 2 deletions

View File

@@ -22,6 +22,8 @@ json = ["serde", "serde_json"]
charset = ["encoding_rs"]
cookies = ["cookie", "cookie_store"]
socks-proxy = ["socks"]
gzip = ["flate2"]
brotli = ["brotli-decompressor"]
[dependencies]
base64 = "0.13"
@@ -40,6 +42,8 @@ webpki-roots = { version = "0.22", optional = true }
rustls = { version = "0.20", optional = true }
rustls-native-certs = { version = "0.6", optional = true }
native-tls = { version = "0.2", optional = true }
flate2 = { version = "1.0.22", optional = true }
brotli-decompressor = { version = "2.3.2", optional = true }
[dev-dependencies]
serde = { version = "1", features = ["derive"] }