[nginx] Update mime-types

Maxim Dounin mdounin at mdounin.ru
Mon Mar 18 18:54:31 UTC 2024


Hello!

On Fri, Mar 15, 2024 at 02:01:13PM +0300, Lafiel wrote:

> # HG changeset patch
> # User Yuriy Izorkin <lafiel at elven.pw>
> # Date 1708074268 -10800
> #      Fri Feb 16 12:04:28 2024 +0300
> # Node ID 24be235c0a9c883718db1e54bf742bd9be782ee4
> # Parent  89bff782528a91ad123b63b624f798e6fd9c8e68
> MIME: change type image/x-ms-bmp to image/image
> 
> For .bmp files the image/bmp mime type is used according to IANA [1].
> 
> In Apache also uses this type [2]:
> $ awk '/^image\/bmp/' mime.types
> image/bmp                                       bmp
> 
> Extension usage statistics, according to httparhcive.org [3]:
> $ awk 'NR==1||/^bmp,/' httparchive_exts.csv
> ext,total_pages,total_requests
> bmp,17013,37954
> dib,22,28
> 
> The csv file was made with the following query:
> 
> SELECT
>   ext,
>   COUNT(distinct pageid) total_pages,
>   COUNT(0) total_requests
> FROM
>   `httparchive.summary_requests.2024_01_01_desktop`
> GROUP BY
>   ext
> ORDER BY
>   total_requests DESC
> 
> Link for reference:
> 
> [1] https://www.iana.org/assignments/media-types/image/bmp
> [2] https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
> [3] https://httparchive.org
> 
> diff -r 89bff782528a -r 24be235c0a9c conf/mime.types
> --- a/conf/mime.types   Wed Feb 14 20:03:00 2024 +0400
> +++ b/conf/mime.types   Fri Feb 16 12:04:28 2024 +0300
> @@ -16,6 +16,7 @@
>      text/x-component                                 htc;
> 
>      image/avif                                       avif;
> +    image/bmp                                        bmp;
>      image/png                                        png;
>      image/svg+xml                                    svg svgz;
>      image/tiff                                       tif tiff;
> @@ -23,7 +24,6 @@
>      image/webp                                       webp;
>      image/x-icon                                     ico;
>      image/x-jng                                      jng;
> -    image/x-ms-bmp                                   bmp;
> 
>      font/woff                                        woff;
>      font/woff2                                       woff2;

Since the bmp extension is already there, it hardly make sense to 
refer to HTTP Archive data.  Rather, I would focus on the browsers 
compatibility, as mentioned earlier in the thread.  Please take a 
look at the patch below.

# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1710787295 -10800
#      Mon Mar 18 21:41:35 2024 +0300
# Node ID 27f50fb1c680b8c9589f555454d100fe3e75b024
# Parent  3c67054eeb098757aaf59a45b3dcf38228a1552b
MIME: changed type for bmp to image/bmp.

At least Chrome, Safari, and Edge do no show image/x-ms-bmp when requested
directly (and instead show a download dialog), but do so for IANA-registered
MIME type image/bmp.  Mozilla considers doing the same
(https://bugzilla.mozilla.org/show_bug.cgi?id=1422725).

Further, Apache uses image/bmp since the bmp extension was added to mime.types
in Apache 1.3.6 (and also used it at least since 1.3.0 in magic-based type
detection).

The bmp extensions with the image/x-ms-bmp type was added in 863:57cb2052dcc6
(nginx 0.4.14), as a part of a large mime.types change, and it is not clear
why image/x-ms-bmp was used instead of image/bmp.

As such, changed MIME type for bmp files to image/bmp.

Requested by Yuriy Izorkin.

diff --git a/conf/mime.types b/conf/mime.types
--- a/conf/mime.types
+++ b/conf/mime.types
@@ -16,6 +16,7 @@ types {
     text/x-component                                 htc;
 
     image/avif                                       avif;
+    image/bmp                                        bmp;
     image/png                                        png;
     image/svg+xml                                    svg svgz;
     image/tiff                                       tif tiff;
@@ -23,7 +24,6 @@ types {
     image/webp                                       webp;
     image/x-icon                                     ico;
     image/x-jng                                      jng;
-    image/x-ms-bmp                                   bmp;
 
     font/woff                                        woff;
     font/woff2                                       woff2;

> # HG changeset patch
> # User Yuriy Izorkin
> # Date 1708074518 -10800
> #      Fri Feb 16 12:08:38 2024 +0300
> # Node ID 94f80eface3b541d7b59d85fcc84d4acfca61e32
> # Parent  24be235c0a9c883718db1e54bf742bd9be782ee4
> MIME: update application/vnd.apple.mpegurl type
> 
> For .m3u and .m3u8 files the application/vnd.apple.mpegurl mime type
> is used according to IANA [1].
> 
> In Apache also uses this extensions [2]:
> $ awk '/m3u/' mime.types
> application/vnd.apple.mpegurl                   m3u8
> audio/x-mpegurl                                 m3u
> 
> There are practically no extensions in httparhcive.org statistics [3]:
> $ awk 'NR==1||/^m3u,/||/^msu8,/' httparchive_exts.csv
> ext,total_pages,total_requests
> m3u,15,302
> 
> But these extensions are often used in various streaming services.
> 
> Link for reference:
> 
> [1] https://www.iana.org/assignments/media-types/application/vnd.apple.mpegurl
> [2] https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
> [3] https://httparchive.org
> 
> diff -r 24be235c0a9c -r 94f80eface3b conf/mime.types
> --- a/conf/mime.types   Fri Feb 16 12:04:28 2024 +0300
> +++ b/conf/mime.types   Fri Feb 16 12:08:38 2024 +0300
> @@ -35,7 +35,7 @@
>      application/pdf                                  pdf;
>      application/postscript                           ps eps ai;
>      application/rtf                                  rtf;
> -    application/vnd.apple.mpegurl                    m3u8;
> +    application/vnd.apple.mpegurl                    m3u m3u8;
>      application/vnd.google-earth.kml+xml             kml;
>      application/vnd.google-earth.kmz                 kmz;
>      application/vnd.ms-excel                         xls;

Note that Apache uses audio/x-mpegurl, which is a separate type.

The m3u extension is historically used by audio playlists in the 
MP3 URL format as originally introduced Fraunhofer, see
https://en.wikipedia.org/wiki/M3U.

While Apple's playlist format is based on the original MP3 URL 
format, the are differences.  In particular, m3u files were 
expected to be in the native charset, while 
application/vnd.apple.mpegurl files are expected to be in UTF-8.  
While HLS specification (RFC 8216, independent submission, an 
informational RFC from Apple) makes no distinction between the two 
extensions, it is quite possible the distinction remains in 
practice.  Apple itself recommends m3u8 extension for HLS 
playlists 
(https://developer.apple.com/documentation/http-live-streaming/deploying-a-basic-http-live-streaming-hls-stream).

While the m3u extension might be worth adding to mime.types, the 
question of the expected type remains.  Using a vendor-specific 
type which implies different handling than a vendor-neutral well 
known format might not be what real users want/expect.

> # HG changeset patch
> # User Yuriy Izorkin
> # Date 1708074976 -10800
> #      Fri Feb 16 12:16:16 2024 +0300
> # Node ID 400a32ebdb646c03c1837704eeed83b2135da0db
> # Parent  94f80eface3b541d7b59d85fcc84d4acfca61e32
> MIME: update application/vnd.ms-excel type
> 
> For .xls, .xlm, .xla, .xlc, .xlt and .xlw files the application/vnd.ms-excel
> mime type according to MSDN blog [1]
> 
> In Apache also uses this extensions [2]:
> $ awk '/xls xlm xla xlc xlt xlw/' mime.types
> application/vnd.ms-excel                        xls xlm xla xlc xlt xlw
> 
> There are practically no extensions in httparhcive.org statistics [3]:
> $ awk 'NR==1||/^xls,/||/^xlm,/||/^xla,/||/^xlc,/||/^xlt,/||/^xlw,/||/^eps3,/' httparchive_exts.csv
> ext,total_pages,total_requests
> xls,22,38
> xlt,2,2
> 
> Link for reference:
> 
> [1] https://web.archive.org/web/20160215155254/http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx
> [2] https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
> [3] https://httparchive.org
> 
> diff -r 94f80eface3b -r 400a32ebdb64 conf/mime.types
> --- a/conf/mime.types   Fri Feb 16 12:08:38 2024 +0300
> +++ b/conf/mime.types   Fri Feb 16 12:16:16 2024 +0300
> @@ -38,7 +38,7 @@
>      application/vnd.apple.mpegurl                    m3u m3u8;
>      application/vnd.google-earth.kml+xml             kml;
>      application/vnd.google-earth.kmz                 kmz;
> -    application/vnd.ms-excel                         xls;
> +    application/vnd.ms-excel                         xls xlm xla xlc xlt xlw;
>      application/vnd.ms-fontobject                    eot;
>      application/vnd.ms-powerpoint                    ppt;
>      application/vnd.oasis.opendocument.graphics      odg;

The numbers provided does not support the idea of adding these 
extensions.

> # HG changeset patch
> # User Yuriy Izorkin
> # Date 1708075032 -10800
> #      Fri Feb 16 12:17:12 2024 +0300
> # Node ID 8fd3313f33fab5a342a3d0bf8fa7ddd642ff76b8
> # Parent  400a32ebdb646c03c1837704eeed83b2135da0db
> MIME: update application/vnd.ms-powerpoint type
> 
> For .pot, .ppt and .pps files the application/vnd.ms-excel mime type
> according to MSDN blog [1].
> 
> In Apache also uses this extensions [2]:
> $ awk '/ppt pps pot/' mime.types
> application/vnd.ms-powerpoint                   ppt pps pot
> 
> Extension usage statistics, according to httparhcive.org [3]:
> $ awk 'NR==1||/^pot,/||/^ppt,/||/^pps,/' httparchive_exts.csv
> ext,total_pages,total_requests
> ppt,5,7
> pot,4,5
> pps,1,3
> 
> Link for reference:
> 
> [1] https://web.archive.org/web/20160215155254/http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx
> [2] https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
> [3] https://httparchive.org
> 
> diff -r 400a32ebdb64 -r 8fd3313f33fa conf/mime.types
> --- a/conf/mime.types   Fri Feb 16 12:16:16 2024 +0300
> +++ b/conf/mime.types   Fri Feb 16 12:17:12 2024 +0300
> @@ -40,7 +40,7 @@
>      application/vnd.google-earth.kmz                 kmz;
>      application/vnd.ms-excel                         xls xlm xla xlc xlt xlw;
>      application/vnd.ms-fontobject                    eot;
> -    application/vnd.ms-powerpoint                    ppt;
> +    application/vnd.ms-powerpoint                    pot ppt pps;
>      application/vnd.oasis.opendocument.graphics      odg;
>      application/vnd.oasis.opendocument.presentation  odp;
>      application/vnd.oasis.opendocument.spreadsheet   ods;

The same here.

> # HG changeset patch
> # User Yuriy Izorkin
> # Date 1708075086 -10800
> #      Fri Feb 16 12:18:06 2024 +0300
> # Node ID f35143b87faea006b9d0dae731867dfa88eecbbd
> # Parent  8fd3313f33fab5a342a3d0bf8fa7ddd642ff76b8
> MIME: update application/vnd.wap.wmlc type
> 
> For .wmlc and .wbxml files the application/vnd.wap.wmlc mime type
> according to IANA [1].
> 
> In Apache also uses this extensions [2]:
> $ awk '/application\/vnd.wap.wbxml/||/application\/vnd.wap.wmlc/' mime.types
> application/vnd.wap.wbxml                       wbxml
> application/vnd.wap.wmlc                        wmlc
> 
> Link for reference:
> 
> [1] https://www.iana.org/assignments/media-types/application/vnd.wap.wmlc
> [2] https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
> 
> diff -r 8fd3313f33fa -r f35143b87fae conf/mime.types
> --- a/conf/mime.types   Fri Feb 16 12:17:12 2024 +0300
> +++ b/conf/mime.types   Fri Feb 16 12:18:06 2024 +0300
> @@ -51,7 +51,7 @@
>                                                       xlsx;
>      application/vnd.openxmlformats-officedocument.wordprocessingml.document
>                                                       docx;
> -    application/vnd.wap.wmlc                         wmlc;
> +    application/vnd.wap.wmlc                         wmlc wbxml;
>      application/wasm                                 wasm;
>      application/x-7z-compressed                      7z;
>      application/x-cocoa                              cco;

WAP in general and WML particularly are dead for a long time now, 
and I would rather consider removing the wmlc extension, as well 
as other vnd.wap types.

Further, wbxml files have their own vendor MIME type registered in 
IANA:

https://www.iana.org/assignments/media-types/application/vnd.wap.wbxml

It can be also seen in Apache mime.types as mentioned in the 
commit log.  If at all, the application/vnd.wap.wbxml type 
probably should be used for such files.  I don't see reasons 
to add wbxml files though.

-- 
Maxim Dounin
http://mdounin.ru/



More information about the nginx-devel mailing list