Skip to content

Commit 8c2f59d

Browse files
committed
fix(cli): detect jsx file mime type
1 parent 7954d02 commit 8c2f59d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cortex-cli/src/run_cmd/mime.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn mime_type_from_extension(path: &Path) -> String {
2020
"xml" => "text/xml",
2121

2222
// Code files
23-
"js" | "mjs" | "cjs" => "text/javascript",
23+
"js" | "jsx" | "mjs" | "cjs" => "text/javascript",
2424
"ts" | "tsx" => "text/typescript",
2525
"json" => "application/json",
2626
"rs" => "text/x-rust",
@@ -75,6 +75,10 @@ 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.jsx")),
80+
"text/javascript"
81+
);
7882
assert_eq!(
7983
mime_type_from_extension(&PathBuf::from("test.png")),
8084
"image/png"

0 commit comments

Comments
 (0)