about summary refs log tree commit diff
path: root/kittybox-rs/src/media/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs/src/media/mod.rs')
-rw-r--r--kittybox-rs/src/media/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/kittybox-rs/src/media/mod.rs b/kittybox-rs/src/media/mod.rs
index b64929d..a8ae6f9 100644
--- a/kittybox-rs/src/media/mod.rs
+++ b/kittybox-rs/src/media/mod.rs
@@ -76,7 +76,11 @@ pub async fn serve<S: MediaStore>(
                 let headers = r.headers_mut().unwrap();
                 headers.insert(
                     "Content-Type",
-                    HeaderValue::from_str(&metadata.content_type).unwrap()
+                    HeaderValue::from_str(
+                        metadata.content_type
+                            .as_deref()
+                            .unwrap_or("application/octet-stream")
+                    ).unwrap()
                 );
                 if let Some(length) = metadata.length {
                     headers.insert(