@@ -281,13 +281,13 @@ fn detect_mime(_content: &Vec<u8>, file_path: &Path) -> Result<String> {
281
281
282
282
fn correct_mime ( mime : & str , file_path : & Path ) -> Result < String > {
283
283
Ok ( match mime {
284
- "text/plain" | "text/troff" | "text/x-markdown" | "text/x-rust" => {
284
+ "text/plain" | "text/troff" | "text/x-markdown" | "text/x-rust" | "text/x-toml" => {
285
285
match file_path. extension ( ) . and_then ( OsStr :: to_str) {
286
286
Some ( "md" ) => "text/markdown" ,
287
287
Some ( "rs" ) => "text/rust" ,
288
288
Some ( "markdown" ) => "text/markdown" ,
289
289
Some ( "css" ) => "text/css" ,
290
- Some ( "toml" ) => "text/x- toml" ,
290
+ Some ( "toml" ) => "text/toml" ,
291
291
Some ( "js" ) => "application/javascript" ,
292
292
Some ( "json" ) => "application/json" ,
293
293
_ => mime
@@ -379,7 +379,7 @@ mod test {
379
379
#[ test]
380
380
fn test_mime_types ( ) {
381
381
check_mime ( "/ignored" , ".gitignore" , "text/plain" ) ;
382
- check_mime ( "[package]" , "hello.toml" , "text/x- toml" ) ;
382
+ check_mime ( "[package]" , "hello.toml" , "text/toml" ) ;
383
383
check_mime ( ".ok { color:red; }" , "hello.css" , "text/css" ) ;
384
384
check_mime ( "var x = 1" , "hello.js" , "application/javascript" ) ;
385
385
check_mime ( "<html>" , "hello.html" , "text/html" ) ;
0 commit comments