fix: mime of javascript (#106)

This commit is contained in:
XYenon 2023-09-05 07:28:24 -05:00 committed by GitHub
parent 9c3d5cc400
commit eee68a99b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,9 @@ rules = [
{ mime = "video/*", use = "video" },
{ mime = "audio/*", use = "audio" },
{ mime = "inode/x-empty", use = "text" },
{ mime = "application/json", use = "text" },
{ mime = "*/javascript", use = "text" },
{ mime = "application/zip", use = "archive" },
{ mime = "application/gzip", use = "archive" },

View File

@ -18,7 +18,7 @@ pub enum MimeKind {
impl MimeKind {
pub fn new(s: &str) -> Self {
if s.starts_with("text/") || s.ends_with("/xml") {
if s.starts_with("text/") || s.ends_with("/xml") || s.ends_with("/javascript") {
Self::Text
} else if s.starts_with("image/") {
Self::Image