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

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

7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Changes

## Unreleased - 2020-xx-xx
* Implement Logger middleware regex exclude pattern [#1723]

* Implement Logger middleware regex exclude pattern [#1723]
robjtede marked this conversation as resolved.
Show resolved Hide resolved
[#1723]: https://github.com/actix/actix-web/pull/1723

### Fixed

* awc now uses `Accept-Encoding: identity` instead of `Accept-Encoding: br` when no compression feature is enabled
[#1737](https://github.com/actix/actix-web/pull/1737)

robjtede marked this conversation as resolved.
Show resolved Hide resolved
## 3.1.0 - 2020-09-29
### Changed
* Add `TrailingSlash::MergeOnly` behaviour to `NormalizePath`, which allows `NormalizePath`
Expand Down
1 change: 1 addition & 0 deletions awc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ actix-rt = "1.0.0"

base64 = "0.12"
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"
Expand Down
13 changes: 9 additions & 4 deletions awc/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down