From 797d26121dfa73f236c0de311fe0d48546a89e91 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 27 Feb 2016 19:52:08 +0000 Subject: [PATCH] MimeMagic: Recognise font files Supported by http://blog.symbolset.com/properly-serve-webfonts > WOFF application/x-font-woff > TTF application/x-font-ttf > EOT application/vnd.ms-fontobject Default nginx registry only contains EOT: https://github.com/wikimedia/operations-debs-nginx/blob/be600c8b/debian/conf/mime.types > application/octet-stream eot; Wikimedia config for Apache: https://github.com/wikimedia/operations-puppet/blob/812f280/modules/mediawiki/files/apache/modules/mime.conf#L53-L57 > AddType application/font-woff .woff > AddType application/font-woff2 .woff2 > AddType application/vnd.ms-fontobject .eot > AddType application/x-font-ttf .ttf Without these changes, wmfstatic is unable to serve UniversalLanguageSelector TFF, EOT, and WOFF font files (currently responds with HTTP 400 error). Example urls: * Content-Type: application/font-woff https://en.wikipedia.org/static/current/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.woff https://en.wikipedia.org/w/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.woff * Content-Type: application/x-font-ttf https://en.wikipedia.org/static/current/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.ttf https://en.wikipedia.org/w/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.ttf * Content-Type: application/vnd.ms-fontobject https://en.wikipedia.org/static/current/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.eot https://en.wikipedia.org/w/extensions/UniversalLanguageSelector/data/fontrepo/fonts/amiri/amiri-bold.eot Change-Id: Iec9459c9217cc0b09517e279189b4b36f0cd1f74 --- includes/mime.types | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/mime.types b/includes/mime.types index 73f27e63c6..1ef4d26f1f 100644 --- a/includes/mime.types +++ b/includes/mime.types @@ -64,6 +64,10 @@ application/xml xml xsl xsd kml application/xml-dtd dtd application/zip zip jar xpi sxc stc sxd std sxi sti sxm stm sxw stw application/x-rar rar +application/font-woff woff +application/font-woff2 woff2 +application/vnd.ms-fontobject eot +application/x-font-ttf ttf audio/basic au snd audio/midi mid midi kar audio/mpeg mpga mp2 mp3 -- 2.20.1