From a68403d09006af3e7f75aacb9e818ce3bcf60b13 Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Sat, 27 Oct 2018 17:26:42 -0700 Subject: Add application/x-typescript mime type support --- src/deno_dir.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/deno_dir.rs b/src/deno_dir.rs index d0c85d134..b0e9ba43c 100644 --- a/src/deno_dir.rs +++ b/src/deno_dir.rs @@ -794,7 +794,8 @@ fn map_content_type(path: &Path, content_type: Option<&str>) -> msg::MediaType { "application/typescript" | "text/typescript" | "video/vnd.dlna.mpeg-tts" - | "video/mp2t" => msg::MediaType::TypeScript, + | "video/mp2t" + | "application/x-typescript" => msg::MediaType::TypeScript, "application/javascript" | "text/javascript" | "application/ecmascript" @@ -857,6 +858,10 @@ fn test_map_content_type() { map_content_type(Path::new("foo/bar"), Some("video/mp2t")), msg::MediaType::TypeScript ); + assert_eq!( + map_content_type(Path::new("foo/bar"), Some("application/x-typescript")), + msg::MediaType::TypeScript + ); assert_eq!( map_content_type(Path::new("foo/bar"), Some("application/javascript")), msg::MediaType::JavaScript -- cgit v1.2.3