fix awc compress feature

This commit is contained in:
fakeshadow 2021-03-26 00:30:52 +08:00
parent 3188ef5731
commit 8beefa643c
4 changed files with 5 additions and 11 deletions

View File

@ -55,7 +55,6 @@ base64 = "0.13"
bitflags = "1.2"
bytes = "1"
bytestring = "1"
cfg-if = "1"
cookie = { version = "0.14.1", features = ["percent-encode"], optional = true }
derive_more = "0.99.5"
encoding_rs = "0.8"

View File

@ -3,6 +3,7 @@
## Unreleased - 2021-xx-xx
### Changed
* `ConnectorService` type is renamed to `BoxConnectorService` [#2081]
* Fix https encoding when enabling `compress` feature.
[#2081]: https://github.com/actix/actix-web/pull/2081

View File

@ -51,7 +51,6 @@ actix-rt = { version = "2.1", default-features = false }
base64 = "0.13"
bytes = "1"
cfg-if = "1.0"
derive_more = "0.99.5"
futures-core = { version = "0.3.7", default-features = false }
itoa = "0.4"

View File

@ -21,15 +21,10 @@ use crate::frozen::FrozenClientRequest;
use crate::sender::{PrepForSendingError, RequestSender, SendClientRequest};
use crate::ClientConfig;
cfg_if::cfg_if! {
if #[cfg(any(feature = "flate2-zlib", feature = "flate2-rust"))] {
const HTTPS_ENCODING: &str = "br, gzip, deflate";
} else if #[cfg(feature = "compress")] {
const HTTPS_ENCODING: &str = "br";
} else {
const HTTPS_ENCODING: &str = "identity";
}
}
#[cfg(feature = "compress")]
const HTTPS_ENCODING: &str = "br, gzip, deflate";
#[cfg(not(feature = "compress"))]
const HTTPS_ENCODING: &str = "br";
/// An HTTP Client request builder
///