Skip to content

Commit

Permalink
Update compression test to manually choose best compression level
Browse files Browse the repository at this point in the history
 * The test code was built assuming that brotli would be running using best compression level.  Since this is no longer the case by default, the test code has been updated to set it manually.
  • Loading branch information
Ameobea authored and jplatte committed Jul 19, 2023
1 parent 9381c9a commit 23de275
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tower-http/src/compression/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ mod tests {

#[tokio::test]
async fn accept_encoding_configuration_works() -> Result<(), crate::BoxError> {
let deflate_only_layer = CompressionLayer::new().no_br().no_gzip();
let deflate_only_layer = CompressionLayer::new()
.quality(CompressionLevel::Best)
.no_br()
.no_gzip();

let mut service = ServiceBuilder::new()
// Compress responses based on the `Accept-Encoding` header.
Expand All @@ -173,7 +176,10 @@ mod tests {

let deflate_bytes_len = bytes.len();

let br_only_layer = CompressionLayer::new().no_gzip().no_deflate();
let br_only_layer = CompressionLayer::new()
.quality(CompressionLevel::Best)
.no_gzip()
.no_deflate();

let mut service = ServiceBuilder::new()
// Compress responses based on the `Accept-Encoding` header.
Expand Down

0 comments on commit 23de275

Please sign in to comment.