Skip to content

Commit

Permalink
Check entire body in extensionless precompressed file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SvizelPritula committed Sep 19, 2024
1 parent 69f5ca0 commit f2db21d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tower-http/src/services/fs/serve_dir/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async fn precompressed_without_extension() {
let mut decoder = GzDecoder::new(&body[..]);
let mut decompressed = String::new();
decoder.read_to_string(&mut decompressed).unwrap();
assert!(decompressed.starts_with("Content."));
assert_eq!(&decompressed, "Content.\n");
}

#[tokio::test]
Expand All @@ -293,7 +293,7 @@ async fn missing_precompressed_without_extension_fallbacks_to_uncompressed() {

let body = res.into_body().collect().await.unwrap().to_bytes();
let body = String::from_utf8(body.to_vec()).unwrap();
assert!(body.starts_with("Content."));
assert_eq!(&body, "Content.\n");
}

#[tokio::test]
Expand Down

0 comments on commit f2db21d

Please sign in to comment.