mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-18 22:31:35 +03:00
fix: mime of javascript (#106)
This commit is contained in:
parent
9c3d5cc400
commit
eee68a99b4
@ -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" },
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user