#306 closed defect (fixed)
mime.types outdated
Reported by: | aitte.myopenid.com | Owned by: | Sergey Kandaurov |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.2.x |
Keywords: | mime mime.types | Cc: | |
uname -a: | 2.6.32-279.22.1.el6.x86_64 | ||
nginx -V: |
nginx version: nginx/1.2.7
built by gcc 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) |
Description
/etc/nginx/mime.types delivers .js files as "application/x-javascript"
According to the RFC (http://www.rfc-editor.org/rfc/rfc4329.txt) it should be "application/javascript" and x-javascript is discouraged by the RFC.
That one definitely needs fixing. Other types in mime.types may need fixing too. This is just the one I know of. It may be time to go through the entire list to verify that it's all correct.
Change History (10)
comment:2 by , 12 years ago
I discovered that .eot is currently registered in mime.types as:
application/octet-stream eot;
This is definitely wrong. It's been officially registered as application/vnd.ms-fontobject.
Combine this with the way that javascript was being served with the deprecated application/x-javascript, and I think it's important that the whole file be re-evaluated to make sure it's correct.
The http://www.iana.org/assignments/media-types site will help with official answers for all registered file types. The rest will have to be found via Google to figure out what the correct mime types for them are.
comment:3 by , 12 years ago
This is my own corrected mime.types file which fixes the .js type, removes the incorrect .eot type, and adds the 4 WebFont types, but more fixes may be needed.
types { text/html html htm shtml; text/css css; text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/javascript js; application/atom+xml atom; application/rss+xml rss; text/mathml mml; text/plain txt; text/vnd.sun.j2me.app-descriptor jad; text/vnd.wap.wml wml; text/x-component htc; image/png png; image/tiff tif tiff; image/vnd.wap.wbmp wbmp; image/x-icon ico; image/x-jng jng; image/x-ms-bmp bmp; image/svg+xml svg svgz; image/webp webp; application/vnd.ms-fontobject eot; application/x-font-ttf ttf; application/x-font-woff woff; application/x-font-opentype otf; application/java-archive jar war ear; application/mac-binhex40 hqx; application/msword doc; application/pdf pdf; application/postscript ps eps ai; application/rtf rtf; application/vnd.ms-excel xls; application/vnd.ms-powerpoint ppt; application/vnd.wap.wmlc wmlc; application/vnd.google-earth.kml+xml kml; application/vnd.google-earth.kmz kmz; application/x-7z-compressed 7z; application/x-cocoa cco; application/x-java-archive-diff jardiff; application/x-java-jnlp-file jnlp; application/x-makeself run; application/x-perl pl pm; application/x-pilot prc pdb; application/x-rar-compressed rar; application/x-redhat-package-manager rpm; application/x-sea sea; application/x-shockwave-flash swf; application/x-stuffit sit; application/x-tcl tcl tk; application/x-x509-ca-cert der pem crt; application/x-xpinstall xpi; application/xhtml+xml xhtml; application/zip zip; application/octet-stream bin exe dll; application/octet-stream deb; application/octet-stream dmg; application/octet-stream iso img; application/octet-stream msi msp msm; audio/midi mid midi kar; audio/mpeg mp3; audio/ogg ogg; audio/x-m4a m4a; audio/x-realaudio ra; video/3gpp 3gpp 3gp; video/mp4 mp4; video/mpeg mpeg mpg; video/quicktime mov; video/webm webm; video/x-flv flv; video/x-m4v m4v; video/x-mng mng; video/x-ms-asf asx asf; video/x-ms-wmv wmv; video/x-msvideo avi; }
comment:4 by , 12 years ago
Several other suggestions to add to mime.types:
text/plain md5 sha1;
archive/xz lzma xz;
binary/tdb-garmin-map tdb;
binary/garmin-style typ;
xml/garmin-track-file gpx;
comment:5 by , 12 years ago
I just discovered that the HTML5 Boilerplate project chose to serve OpenType with this invalid MIME type: "font/opentype". It's not legal ("font/*" is not a valid mime type), but turns out that this is the ONLY way to avoid console errors in Google Chrome! All other mime types will make Google Chrome log an error saying that a font was served with an invalid mime type. So yeah, they really take care of the tiniest details over there and it would be a very good idea to look at their project for fixes to your mime.types file.
comment:6 by , 12 years ago
Keywords: | mime mime.types added |
---|
comment:7 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:10 by , 11 years ago
.eot and .js were committed some time ago.
Others MIME types are not something to be committed.
Summary of fixes:
Follow RFC:
application/javascript js;
Add support for WebFonts:
application/vnd.ms-fontobject eot; (http://www.iana.org/assignments/media-types/application/vnd.ms-fontobject)
application/font-woff woff; (http://www.iana.org/assignments/media-types/application/font-woff)
application/x-font-ttf ttf; (this is the most common mime type for this unregistered format)
application/x-font-opentype otf; (same here; this is the most correct type for this unregistered mime type)