We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e00e20 commit e330ef4Copy full SHA for e330ef4
src/db/file.rs
@@ -92,8 +92,15 @@ pub fn add_path_into_database<P: AsRef<Path>>(conn: &Connection,
92
// css's are causing some problem in browsers
93
// magic will return text/plain for css file types
94
// convert them to text/css
95
- if mime == "text/plain" && file_path_str.ends_with(".css") {
96
- "text/css".to_owned()
+ // do the same for javascript files
+ if mime == "text/plain" {
97
+ if file_path_str.ends_with(".css") {
98
+ "text/css".to_owned()
99
+ } else if file_path_str.ends_with(".js") {
100
+ "application/javascript".to_owned()
101
+ } else {
102
+ mime.to_owned()
103
+ }
104
} else {
105
mime.to_owned()
106
}
0 commit comments