From c856b6e0ffe3caf8cbe7e19b192e0f568bb14454 Mon Sep 17 00:00:00 2001 From: Reeze Xia Date: Sun, 15 Nov 2015 11:08:14 +0800 Subject: [PATCH] Update mime type generator script to keep track of additional mime-types --- sapi/cli/generate_mime_type_map.php | 12 ++++++++++++ sapi/cli/mime_type_map.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php index 9e088814a0..374c38f0ae 100644 --- a/sapi/cli/generate_mime_type_map.php +++ b/sapi/cli/generate_mime_type_map.php @@ -27,6 +27,18 @@ array_walk($types, function ($line) use (&$extensions) { } }); +$additional_mime_maps = [ + "map" => "application/json", // from commit: a0d62f08ae8cbebc88e5c92e08fca8d0cdc7309d +]; + +foreach($additional_mime_maps as $ext => $mime) { + if (!isset($extensions[$ext])) { + $extensions[$ext] = $mime; + } else { + printf(STDERR, "Ignored exist mime type: $ext => $mime\n"); + } +} + ?> /* +----------------------------------------------------------------------+ diff --git a/sapi/cli/mime_type_map.h b/sapi/cli/mime_type_map.h index b9dd6ef759..f4b30a5c6f 100644 --- a/sapi/cli/mime_type_map.h +++ b/sapi/cli/mime_type_map.h @@ -71,7 +71,6 @@ static php_cli_server_ext_mime_type_pair mime_type_map[] = { { "ma", "application/mathematica" }, { "nb", "application/mathematica" }, { "mb", "application/mathematica" }, - { "map", "application/json" }, { "mathml", "application/mathml+xml" }, { "mbox", "application/mbox" }, { "mscml", "application/mediaservercontrol+xml" }, @@ -1010,6 +1009,7 @@ static php_cli_server_ext_mime_type_pair mime_type_map[] = { { "movie", "video/x-sgi-movie" }, { "smv", "video/x-smv" }, { "ice", "x-conference/x-cooltalk" }, + { "map", "application/json" }, { NULL, NULL } }; -- 2.40.0