1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 13:29:24 +00:00

use idenity encoding on client if no compression features are enabled (#1737)

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Jonas 2020-10-24 22:15:01 +02:00 committed by GitHub
parent 41e7cec72f
commit 06e5042b94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View file

@ -1,8 +1,15 @@
# Changes
## Unreleased - 2020-xx-xx
### Changed
* Upgrade `base64` to `0.13`.
### Fixed
* Use `Accept-Encoding: identity` instead of `Accept-Encoding: br` when no compression feature is enabled [#1737]
[#1737]: https://github.com/actix/actix-web/pull/1737
## 2.0.0 - 2020-09-11
### Changed
* `Client::build` was renamed to `Client::builder`.

View file

@ -44,6 +44,7 @@ actix-rt = "1.0.0"
base64 = "0.13"
bytes = "0.5.3"
cfg-if = "1.0"
derive_more = "0.99.2"
futures-core = { version = "0.3.5", default-features = false }
log =" 0.4"

View file

@ -21,10 +21,15 @@ use crate::frozen::FrozenClientRequest;
use crate::sender::{PrepForSendingError, RequestSender, SendClientRequest};
use crate::ClientConfig;
#[cfg(any(feature = "flate2-zlib", feature = "flate2-rust"))]
const HTTPS_ENCODING: &str = "br, gzip, deflate";
#[cfg(not(any(feature = "flate2-zlib", feature = "flate2-rust")))]
const HTTPS_ENCODING: &str = "br";
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";
}
}
/// An HTTP Client request builder
///