We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 568251d commit da19632Copy full SHA for da19632
tests/fixtures/unknown.custom_ext
@@ -0,0 +1 @@
1
+this is an unknown text format
tests/mime.rs
@@ -18,3 +18,12 @@ async fn guess_binary_mime() -> io::Result<()> {
18
assert_eq!(res.content_type(), Some(mime::PNG));
19
Ok(())
20
}
21
+
22
+#[async_std::test]
23
+async fn guess_mime_fallback() -> io::Result<()> {
24
+ let body = Body::from_file("tests/fixtures/unknown.custom_ext").await?;
25
+ let mut res = Response::new(200);
26
+ res.set_body(body);
27
+ assert_eq!(res.content_type(), Some(mime::BYTE_STREAM));
28
+ Ok(())
29
+}
0 commit comments