From c4974118edef5307ec09340c4cbbe920f7c9f723 Mon Sep 17 00:00:00 2001 From: juliuss007 <157698750+juliuss007@users.noreply.github.com> Date: Wed, 27 May 2026 06:28:13 +0200 Subject: [PATCH] fix(cli): detect jsonc and json5 mime types --- src/cortex-cli/src/run_cmd/mime.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cortex-cli/src/run_cmd/mime.rs b/src/cortex-cli/src/run_cmd/mime.rs index 37f1cc90d..6b731de79 100644 --- a/src/cortex-cli/src/run_cmd/mime.rs +++ b/src/cortex-cli/src/run_cmd/mime.rs @@ -22,7 +22,7 @@ pub fn mime_type_from_extension(path: &Path) -> String { // Code files "js" | "mjs" | "cjs" => "text/javascript", "ts" | "tsx" => "text/typescript", - "json" => "application/json", + "json" | "jsonc" | "json5" => "application/json", "rs" => "text/x-rust", "py" => "text/x-python", "rb" => "text/x-ruby", @@ -75,6 +75,14 @@ mod tests { mime_type_from_extension(&PathBuf::from("test.json")), "application/json" ); + assert_eq!( + mime_type_from_extension(&PathBuf::from("test.jsonc")), + "application/json" + ); + assert_eq!( + mime_type_from_extension(&PathBuf::from("test.json5")), + "application/json" + ); assert_eq!( mime_type_from_extension(&PathBuf::from("test.png")), "image/png"