add svg mime type mapping, sort mappings

This commit is contained in:
Scott Lamb 2021-10-02 08:29:56 -07:00
parent 8da5c4aa56
commit 52ec6403d6

View File

@ -1336,15 +1336,16 @@ impl<'a> StaticFileRequest<'a> {
}; };
let ext = &path[last_dot + 1..]; let ext = &path[last_dot + 1..];
let mime = match ext { let mime = match ext {
"css" => "text/css",
"html" => "text/html", "html" => "text/html",
"ico" => "image/x-icon", "ico" => "image/x-icon",
"js" | "map" => "text/javascript", "js" | "map" => "text/javascript",
"json" => "application/json", "json" => "application/json",
"png" => "image/png", "png" => "image/png",
"webmanifest" => "application/manifest+json", "svg" => "image/svg+xml",
"txt" => "text/plain", "txt" => "text/plain",
"webmanifest" => "application/manifest+json",
"woff2" => "font/woff2", "woff2" => "font/woff2",
"css" => "text/css",
_ => return None, _ => return None,
}; };