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 6ec03cb commit c117cf1Copy full SHA for c117cf1
src/db/file.rs
@@ -87,7 +87,17 @@ pub fn add_path_into_database<P: AsRef<Path>>(conn: &Connection,
87
};
88
let mut content: Vec<u8> = Vec::new();
89
try!(file.read_to_end(&mut content));
90
- let mime = try!(cookie.buffer(&content));
+ let mime = {
91
+ let mime = try!(cookie.buffer(&content));
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()
97
+ } else {
98
+ mime.to_owned()
99
+ }
100
+ };
101
102
file_list_with_mimes.push((mime.clone(), file_path_str.clone()));
103
0 commit comments