Skip to content

Commit ae9043f

Browse files
committed
Improve file extension support
1 parent 36163d1 commit ae9043f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

engine/src/assets/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ fn content_type_from_file_name(file_name: &str) -> String {
8080
"js" => "text/javascript".to_string(),
8181
"css" => "text/css".to_string(),
8282
"json" => "application/json".to_string(),
83+
"svg" => "image/svg+xml".to_string(),
84+
"png" => "image/png".to_string(),
85+
"jpg" => "image/jpeg".to_string(),
86+
"jpeg" => "image/jpeg".to_string(),
87+
"gif" => "image/gif".to_string(),
88+
"ico" => "image/x-icon".to_string(),
89+
"webp" => "image/webp".to_string(),
90+
"woff" => "font/woff".to_string(),
91+
"woff2" => "font/woff2".to_string(),
92+
"ttf" => "font/ttf".to_string(),
93+
"otf" => "font/otf".to_string(),
8394
_ => {
8495
info!("Unknown file extension: {:?}", extension);
8596
"application/octet-stream".to_string()

0 commit comments

Comments
 (0)