aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/windmark.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs
index 93eccce..211d235 100644
--- a/examples/windmark.rs
+++ b/examples/windmark.rs
@@ -155,10 +155,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Response::PermanentRedirect("gemini://localhost/test".into())
}),
)
- .mount(
- "/file",
- Box::new(|_| Response::SuccessFile(include_bytes!("../LICENSE"))),
- )
+ .mount("/file", {
+ #[cfg(feature = "auto-deduce-mime")]
+ {
+ Box::new(|_| Response::SuccessFile(include_bytes!("../LICENSE")))
+ }
+
+ #[cfg(not(feature = "auto-deduce-mime"))]
+ Box::new(|_| {
+ Response::SuccessFile(
+ include_bytes!("../LICENSE"),
+ "text/plain".to_string(),
+ )
+ })
+ })
.run()
.await
}