File tree Expand file tree Collapse file tree
src/cortex-cli/src/run_cmd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub fn mime_type_from_extension(path: &Path) -> String {
2222 // Code files
2323 "js" | "mjs" | "cjs" => "text/javascript" ,
2424 "ts" | "tsx" => "text/typescript" ,
25- "json" => "application/json" ,
25+ "json" | "jsonc" | "json5" => "application/json" ,
2626 "rs" => "text/x-rust" ,
2727 "py" => "text/x-python" ,
2828 "rb" => "text/x-ruby" ,
@@ -75,6 +75,14 @@ mod tests {
7575 mime_type_from_extension( & PathBuf :: from( "test.json" ) ) ,
7676 "application/json"
7777 ) ;
78+ assert_eq ! (
79+ mime_type_from_extension( & PathBuf :: from( "test.jsonc" ) ) ,
80+ "application/json"
81+ ) ;
82+ assert_eq ! (
83+ mime_type_from_extension( & PathBuf :: from( "test.json5" ) ) ,
84+ "application/json"
85+ ) ;
7886 assert_eq ! (
7987 mime_type_from_extension( & PathBuf :: from( "test.png" ) ) ,
8088 "image/png"
You can’t perform that action at this time.
0 commit comments