From c86da1327051a2ab68acce0fb5f89a35e4654e78 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 1 May 2023 17:25:22 -0700 Subject: [PATCH] Mark '.exe', '.iso', '.dmg' as known extensions. 'EXE' is IANA registered, and the registered media type is used here for the '.exe' extension. The '.iso' and '.dmg' extensions do not appear to correspond to any IANA registered media type, but they have a de facto media type of "application/octet-stream", and that media type is used by this commit. Closes #2530. --- core/http/src/header/known_media_types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/http/src/header/known_media_types.rs b/core/http/src/header/known_media_types.rs index 2f56ea71..1fe8ce73 100644 --- a/core/http/src/header/known_media_types.rs +++ b/core/http/src/header/known_media_types.rs @@ -52,6 +52,7 @@ macro_rules! known_media_types { EPUB (is_epub): "EPUB", "application", "epub+zip", EventStream (is_event_stream): "SSE stream", "text", "event-stream", Markdown (is_markdown): "markdown text", "text", "markdown" ; "charset" => "utf-8", + EXE (is_exe): "executable", "application", "vnd.microsoft.portable-executable", }) } @@ -95,6 +96,8 @@ macro_rules! known_extensions { "aac" => AAC, "ics" => Calendar, "bin" => Binary, + "iso" => Binary, + "dmg" => Binary, "mpg" => MPEG, "mpeg" => MPEG, "tar" => TAR, @@ -109,6 +112,7 @@ macro_rules! known_extensions { "epub" => EPUB, "md" => Markdown, "markdown" => Markdown, + "exe" => EXE, }) }